ipcalc in 0.42-2 split is broken - segments too small

Bug #1972073 reported by Karl Fischer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ipcalc (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ dpkg -l ipcalc
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=======================================
ii ipcalc 0.42-2 all parameter calculator for IPv4 addresses

ipcalc itself shows version 0.5

# ipcalc -v
0.5

# asked for networks with 50 hosts each it spits out /27 in steps of /26

$ ipcalc 192.168.13.13 -s 50 50 50
Address: 192.168.13.13 11000000.10101000.00001101. 00001101
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network: 192.168.13.0/24 11000000.10101000.00001101. 00000000
HostMin: 192.168.13.1 11000000.10101000.00001101. 00000001
HostMax: 192.168.13.254 11000000.10101000.00001101. 11111110
Broadcast: 192.168.13.255 11000000.10101000.00001101. 11111111
Hosts/Net: 254 Class C, Private Internet

1. Requested size: 50 hosts
Netmask: 255.255.255.224 = 27 11111111.11111111.11111111.111 00000
Network: 192.168.13.0/27 11000000.10101000.00001101.000 00000
HostMin: 192.168.13.1 11000000.10101000.00001101.000 00001
HostMax: 192.168.13.30 11000000.10101000.00001101.000 11110
Broadcast: 192.168.13.31 11000000.10101000.00001101.000 11111
Hosts/Net: 30 Class C, Private Internet

2. Requested size: 50 hosts
Netmask: 255.255.255.224 = 27 11111111.11111111.11111111.111 00000
Network: 192.168.13.64/27 11000000.10101000.00001101.010 00000
HostMin: 192.168.13.65 11000000.10101000.00001101.010 00001
HostMax: 192.168.13.94 11000000.10101000.00001101.010 11110
Broadcast: 192.168.13.95 11000000.10101000.00001101.010 11111
Hosts/Net: 30 Class C, Private Internet

3. Requested size: 50 hosts
Netmask: 255.255.255.224 = 27 11111111.11111111.11111111.111 00000
Network: 192.168.13.128/27 11000000.10101000.00001101.100 00000
HostMin: 192.168.13.129 11000000.10101000.00001101.100 00001
HostMax: 192.168.13.158 11000000.10101000.00001101.100 11110
Broadcast: 192.168.13.159 11000000.10101000.00001101.100 11111
Hosts/Net: 30 Class C, Private Internet

Needed size: 192 addresses.
Used network: 192.168.13.0/24
Unused:
192.168.13.192/26

Older version was correct:

$ dpkg -l ipcalc
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=======================================
ii ipcalc 0.41-5 all parameter calculator for IPv4 addresses

$ ipcalc 192.168.13.13 -s 50 50 50
Address: 192.168.13.13 11000000.10101000.00001101. 00001101
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network: 192.168.13.0/24 11000000.10101000.00001101. 00000000
HostMin: 192.168.13.1 11000000.10101000.00001101. 00000001
HostMax: 192.168.13.254 11000000.10101000.00001101. 11111110
Broadcast: 192.168.13.255 11000000.10101000.00001101. 11111111
Hosts/Net: 254 Class C, Private Internet

1. Requested size: 50 hosts
Netmask: 255.255.255.192 = 26 11111111.11111111.11111111.11 000000
Network: 192.168.13.0/26 11000000.10101000.00001101.00 000000
HostMin: 192.168.13.1 11000000.10101000.00001101.00 000001
HostMax: 192.168.13.62 11000000.10101000.00001101.00 111110
Broadcast: 192.168.13.63 11000000.10101000.00001101.00 111111
Hosts/Net: 62 Class C, Private Internet

2. Requested size: 50 hosts
Netmask: 255.255.255.192 = 26 11111111.11111111.11111111.11 000000
Network: 192.168.13.64/26 11000000.10101000.00001101.01 000000
HostMin: 192.168.13.65 11000000.10101000.00001101.01 000001
HostMax: 192.168.13.126 11000000.10101000.00001101.01 111110
Broadcast: 192.168.13.127 11000000.10101000.00001101.01 111111
Hosts/Net: 62 Class C, Private Internet

3. Requested size: 50 hosts
Netmask: 255.255.255.192 = 26 11111111.11111111.11111111.11 000000
Network: 192.168.13.128/26 11000000.10101000.00001101.10 000000
HostMin: 192.168.13.129 11000000.10101000.00001101.10 000001
HostMax: 192.168.13.190 11000000.10101000.00001101.10 111110
Broadcast: 192.168.13.191 11000000.10101000.00001101.10 111111
Hosts/Net: 62 Class C, Private Internet

Needed size: 192 addresses.
Used network: 192.168.13.0/24
Unused:
192.168.13.192/26

Just found: issue seems to be fixed in 0.51
works fine - so make sure it makes it into ipcalc package soon
https://github.com/kjokjo/ipcalc/blob/master/ipcalc

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.