fedora-python / python-ethtool

Deprecated Python bindings for the ethtool kernel interface
GNU General Public License v2.0
15 stars 13 forks source link

Fix multiple ipv4 addrs bug #53

Closed frenzymadness closed 5 years ago

frenzymadness commented 5 years ago

pifconfig is unable to show multiple IPv4 addresses attached to one interface - this is basically the same behavior as ifconfig command has but there is an old patch in RHEL which allows it so it might be a good idea to backport it here and provide the same functionality in all versions.

Example output in RHEL 7:

dummy0 HWaddr 66:78:8f:23:38:94
          inet addr:10.20.30.40 Bcast:10.20.30.255   Mask:255.255.255.255
          inet addr:10.20.30.45 Bcast:10.20.30.255   Mask:255.255.255.255
          inet addr:10.20.30.50 Bcast:10.20.30.255   Mask:255.255.255.255
      inet6 addr: fe80::6478:8fff:fe23:3894/64 Scope: link
      UP BROADCAST RUNNING NOARP

Example output with the newest ethtool:

dummy0
    HWaddr 6a:83:e2:25:65:69
    inet addr:10.20.30.40
    Bcast:10.20.30.255
    Mask:255.255.255.255
    inet6 addr: fe80::6883:e2ff:fe25:6569/64 Scope: link
    UP BROADCAST RUNNING NOARP

Output with merged patch:

dummy0
    HWaddr 22:ea:1d:9b:c9:e2
    inet addr:10.20.30.40 Bcast:10.20.30.255 Mask:255.255.255.255
    inet addr:10.20.30.45 Bcast:10.20.30.255 Mask:255.255.255.255
    inet addr:10.20.30.50 Bcast:10.20.30.255 Mask:255.255.255.255
    inet6 addr: fe80::20ea:1dff:fe9b:c9e2/64 Scope: link
    UP BROADCAST RUNNING NOARP

I'd say that the last one is the most readable because every IPv4/IPv6 record is on one line.

If you disagree, I'll have to maintain this patch in the new versions of RHEL to keep desired functionality.