From 86719ce77fe01f8c55148be52de8ab1e68da64f2 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Thu, 2 Jan 2014 16:17:24 -0500 Subject: [PATCH] Fixes #5040 setup module: do not add primary interface info to the secondary interface data --- library/system/setup | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/library/system/setup b/library/system/setup index 816039469c5..542280624e4 100755 --- a/library/system/setup +++ b/library/system/setup @@ -1540,8 +1540,7 @@ class LinuxNetwork(Network): iface = words[-1] if iface != device: interfaces[iface] = {} - interfaces[iface].update(interfaces[device]) - if "ipv4_secondaries" not in interfaces[iface]: + if not secondary and "ipv4_secondaries" not in interfaces[iface]: interfaces[iface]["ipv4_secondaries"] = [] if not secondary or "ipv4" not in interfaces[iface]: interfaces[iface]['ipv4'] = {'address': address, @@ -1553,6 +1552,15 @@ class LinuxNetwork(Network): 'netmask': netmask, 'network': network, }) + + # add this secondary IP to the main device + if secondary: + interfaces[device]["ipv4_secondaries"].append({ + 'address': address, + 'netmask': netmask, + 'network': network, + }) + # If this is the default address, update default_ipv4 if 'address' in default_ipv4 and default_ipv4['address'] == address: default_ipv4['netmask'] = netmask