summaryrefslogtreecommitdiff
path: root/cloudinit/net/__init__.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2017-05-19 13:12:54 -0400
committerScott Moser <smoser@brickies.net>2017-05-22 12:10:22 -0400
commit2c0655feb9a194b5fbdfe90a5f847c16f1e15409 (patch)
tree8784af3608dc15580a1f4184cc51dcc1a7f04fab /cloudinit/net/__init__.py
parent3d97b29bd71b9de5fb14d8bd320c20545b88a81b (diff)
downloadvyos-cloud-init-2c0655feb9a194b5fbdfe90a5f847c16f1e15409.tar.gz
vyos-cloud-init-2c0655feb9a194b5fbdfe90a5f847c16f1e15409.zip
Fix get_interfaces_by_mac for empty macs
Some interfaces (greptap0 in the bug) have a mac address of '00:00:00:00:00:00'. That was causing a duplicate mac detection as the 'lo' device also has that mac. The change here is to just ignore macs other than 'lo' that have that. LP: #1692028
Diffstat (limited to 'cloudinit/net/__init__.py')
-rw-r--r--cloudinit/net/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py
index a072a8d6..8c6cd057 100644
--- a/cloudinit/net/__init__.py
+++ b/cloudinit/net/__init__.py
@@ -393,6 +393,7 @@ def get_interfaces_by_mac():
else:
raise
ret = {}
+ empty_mac = '00:00:00:00:00:00'
for name in devs:
if not interface_has_own_mac(name):
continue
@@ -404,6 +405,8 @@ def get_interfaces_by_mac():
# some devices may not have a mac (tun0)
if not mac:
continue
+ if mac == empty_mac and name != 'lo':
+ continue
if mac in ret:
raise RuntimeError(
"duplicate mac found! both '%s' and '%s' have mac '%s'" %