From 26da27e39b497e7ac8609586cadf548b00e88e0b Mon Sep 17 00:00:00 2001 From: Laurence Man Date: Thu, 21 May 2020 16:08:47 -0700 Subject: [PATCH] Only log on err --- dataplane/linux/endpoint_mgr.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dataplane/linux/endpoint_mgr.go b/dataplane/linux/endpoint_mgr.go index 631ffd7556..00ebe21158 100644 --- a/dataplane/linux/endpoint_mgr.go +++ b/dataplane/linux/endpoint_mgr.go @@ -1033,10 +1033,12 @@ func (m *endpointManager) configureInterface(name string) error { return nil } - // Try setting accept_ra to 0 and only log if it failed (it might fail if IPv6 + // Try setting accept_ra to 0 and just log if it failed (it might fail if IPv6 // was disabled). err := m.writeProcSys(fmt.Sprintf("/proc/sys/net/ipv6/conf/%s/accept_ra", name), "0") - log.WithField("ifaceName", name).Warnf("Could not set accept_ra: %v", err) + if err != nil { + log.WithField("ifaceName", name).Warnf("Could not set accept_ra: %v", err) + } log.WithField("ifaceName", name).Info( "Applying /proc/sys configuration to interface.")