Skip to content

Commit 173a98e

Browse files
committed
Fix bug in -u option
Usable addresses now include only addresses from current CIDR, including the end address.
1 parent 16bfa5c commit 173a98e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/subnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ if (( ip_version == 4 )); then
237237
if (( ip_prefix < 26 )); then
238238
! $u &&
239239
let -i ip_start=network_addr_int ip_end=broadcast_addr_int ||
240-
let -i ip_start=network_addr_int+1 ip_end=broadcast_addr_int+1
240+
let -i ip_start=network_addr_int+1 ip_end=broadcast_addr_int-1
241241
print_ipv4 "$ip_start" "$m" "$c"
242242
! $q && ! $u && printf " $NETWORK_ADDR_TOKEN"
243243
printf '%b' "$d"

0 commit comments

Comments
 (0)