Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/npf/npfctl npfctl_bpf_cidr: fix a bug in handling o...



details:   https://anonhg.NetBSD.org/src/rev/c854f0fd33c0
branches:  trunk
changeset: 793426:c854f0fd33c0
user:      rmind <rmind%NetBSD.org@localhost>
date:      Thu Feb 13 00:42:01 2014 +0000

description:
npfctl_bpf_cidr: fix a bug in handling of smaller IPv6 masks.

diffstat:

 usr.sbin/npf/npfctl/npf_bpf_comp.c |  12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diffs (33 lines):

diff -r 4df69ef0c59a -r c854f0fd33c0 usr.sbin/npf/npfctl/npf_bpf_comp.c
--- a/usr.sbin/npf/npfctl/npf_bpf_comp.c        Wed Feb 12 23:24:09 2014 +0000
+++ b/usr.sbin/npf/npfctl/npf_bpf_comp.c        Thu Feb 13 00:42:01 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: npf_bpf_comp.c,v 1.2 2013/11/05 01:50:30 rmind Exp $   */
+/*     $NetBSD: npf_bpf_comp.c,v 1.3 2014/02/13 00:42:01 rmind Exp $   */
 
 /*-
  * Copyright (c) 2010-2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: npf_bpf_comp.c,v 1.2 2013/11/05 01:50:30 rmind Exp $");
+__RCSID("$NetBSD: npf_bpf_comp.c,v 1.3 2014/02/13 00:42:01 rmind Exp $");
 
 #include <stdlib.h>
 #include <stdbool.h>
@@ -424,12 +424,8 @@
                        wordmask = 0xffffffff << (maxmask - length);
                        length = 0;
                } else {
-                       /*
-                        * The mask is zero - just compare the word
-                        * against zero.
-                        */
-                       wordmask = 0;
-                       word = 0;
+                       /* The mask became zero - skip the rest. */
+                       break;
                }
 
                /* A <- IP address (or one word of it) */



Home | Main Index | Thread Index | Old Index