Module Name:    src
Committed By:   rmind
Date:           Sat Mar 15 08:46:01 UTC 2014

Modified Files:
        src/usr.sbin/npf/npfctl: npf_bpf_comp.c

Log Message:
npfctl_bpf_cidr: another buf fix in handling IPv6 masks (bug found on ARM).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/npf/npfctl/npf_bpf_comp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/npf/npfctl/npf_bpf_comp.c
diff -u src/usr.sbin/npf/npfctl/npf_bpf_comp.c:1.3 src/usr.sbin/npf/npfctl/npf_bpf_comp.c:1.4
--- src/usr.sbin/npf/npfctl/npf_bpf_comp.c:1.3	Thu Feb 13 00:42:01 2014
+++ src/usr.sbin/npf/npfctl/npf_bpf_comp.c	Sat Mar 15 08:46:01 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_bpf_comp.c,v 1.3 2014/02/13 00:42:01 rmind Exp $	*/
+/*	$NetBSD: npf_bpf_comp.c,v 1.4 2014/03/15 08:46: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.3 2014/02/13 00:42:01 rmind Exp $");
+__RCSID("$NetBSD: npf_bpf_comp.c,v 1.4 2014/03/15 08:46:01 rmind Exp $");
 
 #include <stdlib.h>
 #include <stdbool.h>
@@ -421,7 +421,7 @@ npfctl_bpf_cidr(npf_bpf_t *ctx, u_int op
 			wordmask = 0;
 			length -= 32;
 		} else if (length) {
-			wordmask = 0xffffffff << (maxmask - length);
+			wordmask = 0xffffffff << (32 - length);
 			length = 0;
 		} else {
 			/* The mask became zero - skip the rest. */

Reply via email to