Bug 1220391 - ipcalc doesn't work for IPv6
Summary: ipcalc doesn't work for IPv6
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukáš Nykrýn
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1222423
Blocks: dualstack 1220694
TreeView+ depends on / blocked
 
Reported: 2015-05-11 13:09 UTC by Nikos Mavrogiannopoulos
Modified: 2015-07-14 07:26 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-05-18 14:07:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Nikos Mavrogiannopoulos 2015-05-11 13:09:47 UTC
Description of problem: According to ipcalc manpage it should work with IPv6 or IPv4. However, only IPv4 works.

$ ipcalc -nmp 192.168.1.1/24
NETMASK=255.255.255.0
PREFIX=24
NETWORK=192.168.1.0

$ ipcalc -6 -p fd91:6d87:7341:db6a:0:52:190c:be01/64
ipcalc: unable to show setting for IPv6


Expected results:
It should work with IPv6, or should be documented not to.

Comment 1 Lukáš Nykrýn 2015-05-11 13:50:12 UTC
Hmm it looks that -6 only work in combintaion with -c and -h .
I will probably just document that other option does not work, but patches are highly appreciated.

Comment 2 Nikos Mavrogiannopoulos 2015-05-11 19:33:46 UTC
I need a tool that outputs something like http://jodies.de/ipcalc for IPv6 as well. I've put my "patch" to github:

https://github.com/nmav/ipcalc

Comment 3 Nikos Mavrogiannopoulos 2015-05-12 08:18:21 UTC
I've made it backwards compatible, and print detailed information by default as well. Consider using that version for initscripts.

$ ./ipcalc -i fd0b:a336:4e7d::/48
Full Address:	fd0b:a336:4e7d:0000:0000:0000:0000:0000
Address:	fd0b:a336:4e7d::
Full Network:	fd0b:a336:4e7d:0000:0000:0000:0000:0000
Network:	fd0b:a336:4e7d::/48
Address space:	Unique Local Unicast
Netmask:	ffff:ffff:ffff:: = 48

HostMin:	fd0b:a336:4e7d::
HostMax:	fd0b:a336:4e7d:ffff:ffff:ffff:ffff:ffff
Hosts/Net:	2^(80)

$ ./ipcalc -bmnp --minaddr --maxaddr --addrspace fd0b:a336:4e7d::/48
NETMASK=ffff:ffff:ffff::
PREFIX=48
NETWORK=fd0b:a336:4e7d::
MINADDR=fd0b:a336:4e7d::
MAXADDR=fd0b:a336:4e7d:ffff:ffff:ffff:ffff:ffff
ADDRSPACE="Unique Local Unicast"

$ ./ipcalc -c fd0b:a336:4e7d::/48

$  ./ipcalc -4 -c fd0b:a336:4e7d::/48
ipcalc: bad prefix: 48

Comment 4 Lukáš Nykrýn 2015-05-12 08:33:02 UTC
Thanks! Looks good. I will try to review it and merge those patches in upstream.
Not sure if I will make it this week, unfortunately I am a little bit busy with rhel, but I have add it to my todo, so I will not forget.

Comment 5 Nikos Mavrogiannopoulos 2015-05-13 07:58:39 UTC
(In reply to Lukáš Nykrýn from comment #4)
> Thanks! Looks good. I will try to review it and merge those patches in
> upstream.
> Not sure if I will make it this week, unfortunately I am a little bit busy
> with rhel, but I have add it to my todo, so I will not forget.

Wouldn't it make sense to make the github version the upstream one, and simply include it in initscripts? It could allow easier merging of fixes and updated. I could give you access to github repo if you want.

Comment 6 Lukáš Nykrýn 2015-05-15 15:20:47 UTC
I am trying to slowly destroy the initscripts package, so maybe would you be interested in the possibility of creating a new fedora package with your ipcalc? Then I could drop it from initscripts completely and be one more step closer to its elimination.

Comment 7 Nikos Mavrogiannopoulos 2015-05-16 13:48:01 UTC
(In reply to Lukáš Nykrýn from comment #6)
> I am trying to slowly destroy the initscripts package, so maybe would you be
> interested in the possibility of creating a new fedora package with your
> ipcalc?

If I do it, would you review the new package?

Comment 8 Lukáš Nykrýn 2015-05-18 06:51:49 UTC
> If I do it, would you review the new package?

Yep.

Comment 9 Nikos Mavrogiannopoulos 2015-05-18 08:06:47 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1222423

Comment 10 Nikos Mavrogiannopoulos 2015-05-18 14:07:44 UTC
Fix scheduled for f23.


Note You need to log in before you can comment on or make changes to this bug.