diff options
author | Dave Malcolm <dmalcolm@redhat.com> | 2011-07-01 19:00:00 -0400 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2011-07-06 08:09:22 +0200 |
commit | 0bfcfc18fa81fcbb9c9c3a1c715d013e25cf46ca (patch) | |
tree | 9ec17a9b034ba16e14f6300c8d0240b9c31e4c8e | |
parent | a45819ecb5580aeeb09c6c2201929257f5d311d2 (diff) | |
download | python-ethtool-0bfcfc18fa81fcbb9c9c3a1c715d013e25cf46ca.tar.gz python-ethtool-0bfcfc18fa81fcbb9c9c3a1c715d013e25cf46ca.tar.xz python-ethtool-0bfcfc18fa81fcbb9c9c3a1c715d013e25cf46ca.zip |
pifethtool: Show IPv6 address information when available
Signed-off-by: David Sommerseth <davids@redhat.com>
-rwxr-xr-x | pifconfig.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pifconfig.py b/pifconfig.py index d509483..1536071 100755 --- a/pifconfig.py +++ b/pifconfig.py @@ -65,9 +65,15 @@ def show_config(device): inet addr:%s''' % ipaddr, if not (flags & (ethtool.IFF_LOOPBACK | ethtool.IFF_POINTOPOINT)): print "Bcast:%s" % ethtool.get_broadcast(device), - print ''' Mask:%s - %s -''' % (netmask, flags2str(flags)) + print ' Mask:%s' % netmask + for info in ethtool.get_interfaces_info(device): + for addr in info.get_ipv6_addresses(): + print (" inet6 addr: %s/%s Scope: %s" + % (addr.address, + addr.netmask, + addr.scope)) + print ' %s' % flags2str(flags) + print def main(): global all_devices |