avoid possible errors with new broadcast handling in linux

This commit is contained in:
Brian Coca 2015-08-06 09:00:52 -04:00
parent cb2cfaebda
commit 08e6c1d82b

View file

@ -1877,10 +1877,12 @@ class LinuxNetwork(Network):
if not line:
continue
words = line.split()
broadcast = ''
if words[0] == 'inet':
if '/' in words[1]:
address, netmask_length = words[1].split('/')
broadcast = words[3]
if len(words) > 3:
broadcast = words[3]
else:
# pointopoint interfaces do not have a prefix
address = words[1]