From 8a4fa93202e55d4065c0c604cd4290635c039e35 Mon Sep 17 00:00:00 2001 From: Sven Dowideit Date: Mon, 13 Mar 2017 14:27:24 +1000 Subject: [PATCH] lets also not replace routes :( Signed-off-by: Sven Dowideit --- netconf/netconf_linux.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/netconf/netconf_linux.go b/netconf/netconf_linux.go index a03f34f3..30015fca 100755 --- a/netconf/netconf_linux.go +++ b/netconf/netconf_linux.go @@ -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