nitefood / asn

ASN / RPKI validity / BGP stats / IPv4v6 / Prefix / URL / ASPath / Organization / IP reputation / IP geolocation / IP fingerprinting / Network recon / lookup API server / Web traceroute server
MIT License
1.31k stars 159 forks source link

Not every ipcalc(1) supports '-r' #21

Closed robert-scheck closed 2 years ago

robert-scheck commented 2 years ago

Not every ipcalc supports -r as it seems, thus I see the following in the output somewhere in the middle while using asn from commit 64e9253:

ipcalc: bad argument -r: unknown option                                                        
Usage: ipcalc [OPTION...]
  -c, --check         Validate IP address for specified address family
  -4, --ipv4          IPv4 address family (default)
  -6, --ipv6          IPv6 address family
  -b, --broadcast     Display calculated broadcast address
  -h, --hostname      Show hostname determined via DNS
  -m, --netmask       Display default netmask for IP (class A, B, or C)
  -n, --network       Display network address
  -p, --prefix        Display network prefix
  -s, --silent        Don't ever display error messages

Help options:
  -?, --help          Show this help message
  --usage             Display brief usage message
$ rpm -qf `which ipcalc`
initscripts-9.49.53-1.el7_9.1.x86_64
$ 
nitefood commented 2 years ago

Well, -r (deaggregate) was introduced in ipcalc v0.36-pre1 which dates back to more than 17 years ago - I guess we shall have to compromise on that. Which version are you using, and on what OS?

robert-scheck commented 2 years ago

I didn't dig into these details, the system is a fully up-to-date Red Hat Enterprise Linux 7 or CentOS 7 being initially released in 2014 and receiving support until 2024. Not sure which ipcalc flavor you linked, but mine is a ELF binary, not a Perl script. The source code in the SRPM is very similar to this ipcalc.c.

But yes, declaring RHEL/CentOS 7 as too old to ship a usable ipcalc might be a valid option, too.

nitefood commented 2 years ago

Ah, that might be it then. Every other supported distro I initially tested the script on, shipped the original ipcalc (which is a perl script). Back then, I remember ruling out some older distro versions because of such shortcomings (that is why I initially specified CentOS 8 and not just CentOS).