Module Name:    src
Committed By:   christos
Date:           Fri Nov 18 16:01:01 UTC 2022

Modified Files:
        src/external/bsd/blocklist/bin: conf.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/blocklist/bin/conf.c

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

Modified files:

Index: src/external/bsd/blocklist/bin/conf.c
diff -u src/external/bsd/blocklist/bin/conf.c:1.2 src/external/bsd/blocklist/bin/conf.c:1.3
--- src/external/bsd/blocklist/bin/conf.c:1.2	Mon Jun 13 11:00:20 2022
+++ src/external/bsd/blocklist/bin/conf.c	Fri Nov 18 11:01:00 2022
@@ -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 @@ conf_amask_eq(const void *v1, const void
 	uint32_t m;
 	int omask = mask;
 
-	len >>= 2;
 	switch (mask) {
 	case FSTAR:
 		if (memcmp(v1, v2, len) == 0)
@@ -485,7 +484,7 @@ conf_amask_eq(const void *v1, const void
 		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 @@ conf_amask_eq(const void *v1, const void
 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__,

Reply via email to