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
This commit is contained in:
parent
ee628685e8
commit
2888eb4091
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=356863
11
sys/net/if.c
11
sys/net/if.c
@ -1867,10 +1867,13 @@ ifa_maintain_loopback_route(int cmd, const char *otype, struct ifaddr *ifa,
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user