Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/blocklist/bin Allow configuration of addresses ...



details:   https://anonhg.NetBSD.org/src/rev/f342fcb013e6
branches:  trunk
changeset: 372367:f342fcb013e6
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Nov 18 16:01:00 2022 +0000

description:
Allow configuration of addresses without a mask/prefix (Jose Luis Duran)

diffstat:

 external/bsd/blocklist/bin/conf.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r 53df5651093d -r f342fcb013e6 external/bsd/blocklist/bin/conf.c
--- a/external/bsd/blocklist/bin/conf.c Fri Nov 18 07:41:31 2022 +0000
+++ b/external/bsd/blocklist/bin/conf.c Fri Nov 18 16:01:00 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.2 2022/06/13 15:00:20 christos Exp $        */
+/*     $NetBSD: conf.c,v 1.3 2022/11/18 16:01:00 christos Exp $        */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: conf.c,v 1.2 2022/06/13 15:00:20 christos Exp $");
+__RCSID("$NetBSD: conf.c,v 1.3 2022/11/18 16:01:00 christos Exp $");
 
 #include <stdio.h>
 #ifdef HAVE_LIBUTIL_H
@@ -471,7 +471,6 @@
        uint32_t m;
        int omask = mask;
 
-       len >>= 2;
        switch (mask) {
        case FSTAR:
                if (memcmp(v1, v2, len) == 0)
@@ -485,7 +484,7 @@
                break;
        }
 
-       for (size_t i = 0; i < len; i++) {
+       for (size_t i = 0; i < (len >> 2); i++) {
                if (mask > 32) {
                        m = htonl((uint32_t)~0);
                        mask -= 32;
@@ -501,7 +500,6 @@
 out:
        if (debug > 1) {
                char b1[256], b2[256];
-               len <<= 2;
                blhexdump(b1, sizeof(b1), "a1", v1, len);
                blhexdump(b2, sizeof(b2), "a2", v2, len);
                (*lfun)(LOG_DEBUG, "%s: %s != %s [0x%x]", __func__,



Home | Main Index | Thread Index | Old Index