Skip to content

Commit

Permalink
CA-404297: Should not bring up extra interfaces
Browse files Browse the repository at this point in the history
XS8 use initscripts to manage interface, thus it
- Write configuration (/etc/sysconfig/network-scripts/ifcfg-xxx)
for all interfaces
- Bring up only the interested interface

In XS9, systemd-networkd is managing the interfaces.
After configuration for all interfaces, `networkctl reload` just
bring up all interfaces. This is not right as extra interfaces
are brought up.

To fix the issue, only the interested interface should be configured

Signed-off-by: Lin Liu <[email protected]>
  • Loading branch information
liulinC committed Jan 8, 2025
1 parent 137a3d0 commit ca5bf1b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions init
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,8 @@ def configureNetworking(ui, device, config):
netcfg[i] = NetInterface(NetInterface.DHCP, nethw[i].hwaddr,
vlan=config_dict['vlan'])

netutil.writeNetInterfaceFiles(netcfg)
netutil.writeResolverFile(netcfg, '/etc/resolv.conf')

# Reload network to apply the configuration
netutil.reloadNetwork()

iface_to_start = []
if device == 'all':
Expand All @@ -83,6 +80,10 @@ def configureNetworking(ui, device, config):
for i in iface_to_start:
netutil.ifup(netcfg[i].getInterfaceName(i))
netcfg[i].waitUntilUp(i)
netcfg[i].writeSystemdNetworkdConfig(i)

# Reload network to apply the configuration
netutil.reloadNetwork()

if ui:
ui.progress.clearModelessDialog()
Expand Down

0 comments on commit ca5bf1b

Please sign in to comment.