Skip to content

Commit 0bfcfc1

Browse files
davidmalcolmDavid Sommerseth
authored andcommitted
pifethtool: Show IPv6 address information when available
Signed-off-by: David Sommerseth <davids@redhat.com>
1 parent a45819e commit 0bfcfc1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pifconfig.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,15 @@ def show_config(device):
6565
inet addr:%s''' % ipaddr,
6666
if not (flags & (ethtool.IFF_LOOPBACK | ethtool.IFF_POINTOPOINT)):
6767
print "Bcast:%s" % ethtool.get_broadcast(device),
68-
print ''' Mask:%s
69-
%s
70-
''' % (netmask, flags2str(flags))
68+
print ' Mask:%s' % netmask
69+
for info in ethtool.get_interfaces_info(device):
70+
for addr in info.get_ipv6_addresses():
71+
print (" inet6 addr: %s/%s Scope: %s"
72+
% (addr.address,
73+
addr.netmask,
74+
addr.scope))
75+
print ' %s' % flags2str(flags)
76+
print
7177

7278
def main():
7379
global all_devices

0 commit comments

Comments
 (0)