Skip to content

Commit dd285ef

Browse files
authored
NetworkManager: only set secondary interfaces as up (#378)
The primary interface will already be up, by doing "conn up" we are forcing primary interface to be "reloaded" twice as we just reloaded the configuration with "conn reload" - by double "reloading" the primary interface we are forcing it to be unavailable longer than we need it to.
1 parent fb226cb commit dd285ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

google_guest_agent/network/manager/network_manager_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ func (n networkManager) SetupEthernetInterface(ctx context.Context, config *cfg.
150150
return fmt.Errorf("error reloading NetworkManager config cache: %v", err)
151151
}
152152

153-
// Enable the new connections.
154-
for _, ifname := range interfaces {
153+
// Enable the new connections. Ignore the primary interface as it will already be up.
154+
for _, ifname := range interfaces[1:] {
155155
if err = run.Quiet(ctx, "nmcli", "conn", "up", "ifname", ifname); err != nil {
156156
return fmt.Errorf("error enabling connection %s: %v", ifname, err)
157157
}

0 commit comments

Comments
 (0)