From ec0fbd6e2c0135e616e473242f2f27f35ed9a569 Mon Sep 17 00:00:00 2001 From: niusmallnan Date: Mon, 19 Nov 2018 11:56:12 +0800 Subject: [PATCH] Revert "Change dhcpcd master node startup function" This reverts commit b1c5892b87a5161014b40332ce019e78ee41ba0c. --- pkg/netconf/netconf_linux.go | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/pkg/netconf/netconf_linux.go b/pkg/netconf/netconf_linux.go index 5bbe9ea4..1f4c4316 100644 --- a/pkg/netconf/netconf_linux.go +++ b/pkg/netconf/netconf_linux.go @@ -24,11 +24,10 @@ const ( ) var ( - defaultDhcpArgs = []string{"dhcpcd", "-MA4"} - inactiveDhcpArgs = []string{"dhcpcd", "-MA4", "--inactive"} - exitDhcpArgs = []string{"dhcpcd", "-x"} - exitWpaArgs = []string{"wpa_cli", "terminate"} - dhcpReleaseCmd = "dhcpcd --release" + defaultDhcpArgs = []string{"dhcpcd", "-MA4"} + exitDhcpArgs = []string{"dhcpcd", "-x"} + exitWpaArgs = []string{"wpa_cli", "terminate"} + dhcpReleaseCmd = "dhcpcd --release" ) func createInterfaces(netCfg *NetworkConfig) { @@ -179,12 +178,7 @@ func ApplyNetworkConfigs(netCfg *NetworkConfig, userSetHostname, userSetDNS bool wg := sync.WaitGroup{} - // Don't start any interfaces other than those specified on the command line. - // This allows dhcpcd to be started in Master mode. - // Then wait for subsequent dhcpcd commands to start each interface as required. - runInactiveDhcp() - - // apply network config + //apply network config for _, link := range links { applyOuter(link, netCfg, &wg, userSetHostname, userSetDNS) } @@ -288,15 +282,6 @@ func hasDhcp(iface string) bool { return len(out) > 0 } -func runInactiveDhcp() { - cmd := exec.Command(inactiveDhcpArgs[0], inactiveDhcpArgs[1:]...) - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - if err := cmd.Run(); err != nil { - log.Errorf("Failed to run command [%v]: %v", cmd, err) - } -} - func runDhcp(netCfg *NetworkConfig, iface string, argstr string, setHostname, setDNS bool) { args := []string{} if argstr != "" {