static int in_prefixlen(struct sockaddr *sa) { in_addr_t mask; int cidr; mask = in_netmask(sa); if (mask == 0) /* mask 0 ==> /0 */ return 0; cidr = 33 - ffs(mask); /* 33 - (1 .. 32) -> 32 .. 1 */ if (cidr < 32) { /* more than 1 bit in mask */ /* check for non-contig netmask */ if ((mask ^ (((1 << cidr) - 1) << (32 - cidr))) != 0) // <- here return -1; /* noncontig, no pfxlen */ } return cidr; } # ifconfig alc0: flags=0x8843 mtu 1500 ec_capabilities=3 ec_enabled=0 address: xx:xx:xx:xx:xx:xx /public/src.git/sbin/ifconfig/af_inet.c:102:34: runtime error: left shift of 16777215 by 8 places cannot be represented in type 'int' inet 192.168.0.38/24 broadcast 192.168.0.255 flags 0x0 inet6 xxxx::xxxx:xxxx:xxxx:xxx%alc0/64 flags 0x0 scopeid 0x1 lo0: flags=0x8049 mtu 33624 inet 127.0.0.1/8 flags 0x0 inet6 ::1/128 flags 0x20 inet6 fe80::1%lo0/64 flags 0x0 scopeid 0x2