From e2c7aeca4c970aa76899b5491ecbd4a7db371288 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 --- system/setup | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/system/setup b/system/setup index 816039469c5..542280624e4 100755 --- a/system/setup +++ b/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