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: another buf fix in hand...



details:   https://anonhg.NetBSD.org/src/rev/e310c25320b6
branches:  trunk
changeset: 794450:e310c25320b6
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sat Mar 15 08:46:01 2014 +0000

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

diffstat:

 usr.sbin/npf/npfctl/npf_bpf_comp.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 99538b091aaf -r e310c25320b6 usr.sbin/npf/npfctl/npf_bpf_comp.c
--- a/usr.sbin/npf/npfctl/npf_bpf_comp.c        Sat Mar 15 08:00:19 2014 +0000
+++ b/usr.sbin/npf/npfctl/npf_bpf_comp.c        Sat Mar 15 08:46:01 2014 +0000
@@ -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 @@
                        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. */



Home | Main Index | Thread Index | Old Index