Don't add a broadcast address for v6 addresses.
This commit is contained in:
parent
4149504e77
commit
ce3a015f23
@ -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':
|
||||
|
@ -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')
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user