Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Jan 2020 04:48:06 +0000 (UTC)
From:      Eugene Grosbein <eugen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r356863 - head/sys/net
Message-ID:  <202001180448.00I4m6rO082233@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eugen
Date: Sat Jan 18 04:48:05 2020
New Revision: 356863
URL: https://svnweb.freebsd.org/changeset/base/356863

Log:
  ifa_maintain_loopback_route: adjust debugging output
  
  Correction after r333476:
  
  - write this as LOG_DEBUG again instead of LOG_INFO;
  - get back function name into the message;
  - error may be ESRCH if an address is removed in process (by carp f.e.),
  not only ENOENT;
  - expression complexity grows, so try making it more readable.
  
  MFC after:	1 week

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Sat Jan 18 04:12:41 2020	(r356862)
+++ head/sys/net/if.c	Sat Jan 18 04:48:05 2020	(r356863)
@@ -1867,10 +1867,13 @@ ifa_maintain_loopback_route(int cmd, const char *otype
 	if (rti_ifa != NULL)
 		ifa_free(rti_ifa);
 
-	if (error != 0 &&
-	    !(cmd == RTM_ADD && error == EEXIST) &&
-	    !(cmd == RTM_DELETE && error == ENOENT))
-		if_printf(ifp, "%s failed: %d\n", otype, error);
+	if (error == 0 ||
+	    (cmd == RTM_ADD && error == EEXIST) ||
+	    (cmd == RTM_DELETE && (error == ENOENT || error == ESRCH)))
+		return (error);
+
+	log(LOG_DEBUG, "%s: %s failed for interface %s: %u\n",
+		__func__, otype, if_name(ifp), error);
 
 	return (error);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001180448.00I4m6rO082233>