1
0
mirror of https://github.com/rancher/os.git synced 2025-07-04 10:36:14 +00:00

Optimize the startup process for wifi network

This commit is contained in:
Jason-ZW 2018-11-19 16:44:19 +08:00 committed by niusmallnan
parent cdc7906910
commit f508c86d5a

View File

@ -180,7 +180,17 @@ func ApplyNetworkConfigs(netCfg *NetworkConfig, userSetHostname, userSetDNS bool
//apply network config
for _, link := range links {
applyOuter(link, netCfg, &wg, userSetHostname, userSetDNS)
if !strings.Contains(link.Attrs().Name, "wlan") {
applyOuter(link, netCfg, &wg, userSetHostname, userSetDNS)
}
}
wg.Wait()
// apply wifi network config
for _, link := range links {
if strings.Contains(link.Attrs().Name, "wlan") {
applyOuter(link, netCfg, &wg, userSetHostname, userSetDNS)
}
}
wg.Wait()
@ -337,7 +347,7 @@ func runWifiDhcp(netCfg *NetworkConfig, link netlink.Link, network string, setHo
removeAddress(addr, link)
}
runDhcp(netCfg, iface, "", !setHostname, setDNS)
runDhcp(netCfg, iface, "", setHostname, setDNS)
}
func linkUp(link netlink.Link, netConf InterfaceConfig) error {