1
0
mirror of https://github.com/rancher/os.git synced 2025-07-31 06:32:09 +00:00

lets also not replace routes :(

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit 2017-03-13 14:27:24 +10:00
parent 78c08c4dd9
commit 8a4fa93202

View File

@ -306,6 +306,7 @@ func setGateway(gateway string, add bool) error {
log.Errorf("gateway add failed: %v", err)
return err
}
log.Infof("Added default gateway %s", gateway)
} else {
if err := netlink.RouteReplace(&route); err == syscall.EEXIST {
//Ignore this error
@ -313,9 +314,9 @@ func setGateway(gateway string, add bool) error {
log.Errorf("gateway replace failed: %v", err)
return err
}
log.Infof("Replaced default gateway %s", gateway)
}
log.Infof("Set default gateway %s", gateway)
return nil
}
@ -406,7 +407,7 @@ func applyInterfaceConfig(link netlink.Link, netConf InterfaceConfig) error {
}
// replace the existing gw with the main ipv4 one
if err := setGateway(netConf.Gateway, false); err != nil {
if err := setGateway(netConf.Gateway, true); err != nil {
log.Errorf("Fail to set gateway %s", netConf.Gateway)
}
//and then add the ipv6 one if it exists