Merge pull request #107 from ryanpetrello/master

Don't add a broadcast address for v6 addresses.
This commit is contained in:
Jeremy Hanmer 2015-02-02 14:53:37 -08:00
commit cb0b71b2c7
2 changed files with 3 additions and 5 deletions

View File

@ -196,7 +196,7 @@ class IPManager(base.Manager):
"""
family = {4: 'inet', 6: 'inet6'}[address[0].version]
args = ['addr', cmd, '%s/%s' % (address[0], address[1])]
if cmd == 'add':
if family == 'inet' and cmd == 'add':
args += ['brd', '+']
args += ['dev', real_ifname]
if family == 'inet6':

View File

@ -261,8 +261,7 @@ class IPTestCase(TestCase):
mock.call([cmd, 'addr', 'show', 'em0']),
mock.call([
cmd, '-6', 'addr', 'add',
'fdca:3ba5:a17a:acda:20c:29ff:fe94:723d/64', 'brd', '+',
'dev', 'em0'
'fdca:3ba5:a17a:acda:20c:29ff:fe94:723d/64', 'dev', 'em0'
], 'sudo'),
mock.call([cmd, 'link', 'set', 'em0', 'up'], 'sudo'),
mock.call([cmd, 'addr', 'show', 'em0'])
@ -367,8 +366,7 @@ class IPTestCase(TestCase):
mock.call([cmd, 'link', 'set', 'eth0', 'up'], 'sudo'),
mock.call([
cmd, '-6', 'addr', 'add',
'fdca:3ba5:a17a:acda:f816:3eff:fe34:ba28/64', 'brd', '+',
'dev', 'eth0'
'fdca:3ba5:a17a:acda:f816:3eff:fe34:ba28/64', 'dev', 'eth0'
], 'sudo'),
mock.call([cmd, 'link', 'set', 'eth0', 'up'], 'sudo')
]