Skip to content

Commit

Permalink
tools/nut-scanner/nut-scanner.c: add a warning comment about bit-coun…
Browse files Browse the repository at this point in the history
…ting for `-m auto` [networkupstools#2244, networkupstools#2516]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jul 9, 2024
1 parent a4734f0 commit fd4106a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/nut-scanner/nut-scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit fd4106a

Please sign in to comment.