From fd4106aca3fd7373f45265b2bb65e37b6b44a68a Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 9 Jul 2024 22:03:14 +0200 Subject: [PATCH] tools/nut-scanner/nut-scanner.c: add a warning comment about bit-counting for `-m auto` [#2244, #2516] Signed-off-by: Jim Klimov --- tools/nut-scanner/nut-scanner.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/nut-scanner/nut-scanner.c b/tools/nut-scanner/nut-scanner.c index f2d6aaacd2..9628171ea8 100644 --- a/tools/nut-scanner/nut-scanner.c +++ b/tools/nut-scanner/nut-scanner.c @@ -671,6 +671,13 @@ static void handle_arg_cidr(const char *arg_addr, int *auto_nets_ptr) memcpy (&sa, ifa->ifa_addr, sizeof(struct sockaddr_in6)); memcpy (&sm, ifa->ifa_netmask, sizeof(struct sockaddr_in6)); + /* FIXME: Here and below, this code + * technically just counts set bits + * and we assume they are a single + * contiguous range in the address + * portion of the IP address for a + * netmask. + */ masklen_subnet = 0; for (j = 0; j < 16; j++) { i = sm.sin6_addr.s6_addr[j];