diff options
| author | Sergey Nikiforov <Sergey.Nikiforov@kaspersky.com> | 2020-02-11 11:07:13 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-02-11 11:07:13 +0000 |
| commit | a4819e456c7525890a2647775a9b5553b8659a3f (patch) | |
| tree | 1d9f9a7baae440790de0ea18bba612acab810036 /src/ipv6.c | |
| parent | eaf099b3e5caaa11b2034ea82fe4c192e81e2ce8 (diff) | |
| download | dhcpcd-a4819e456c7525890a2647775a9b5553b8659a3f.tar.xz | |
logerr: Use macros to call log functions
This allows downstream implementions to inject their own data
into the log message and/or supply new logging targets whilst
preserving macros such as __FILE__ and __LINE__.
Diffstat (limited to 'src/ipv6.c')
| -rw-r--r-- | src/ipv6.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -36,6 +36,7 @@ #include <net/route.h> #include <netinet/in.h> #include <netinet/if_ether.h> +#include <syslog.h> #include "config.h" @@ -616,7 +617,7 @@ ipv6_addaddr1(struct ipv6_addr *ia, const struct timespec *now) { struct interface *ifp; uint32_t pltime, vltime; - __printflike(1, 2) void (*logfunc)(const char *, ...); + int loglevel; #ifdef ND6_ADVERTISE bool vltime_was_zero = ia->prefix_vltime == 0; #endif @@ -675,8 +676,8 @@ ipv6_addaddr1(struct ipv6_addr *ia, const struct timespec *now) } } - logfunc = ia->flags & IPV6_AF_NEW ? loginfox : logdebugx; - logfunc("%s: adding %saddress %s", ifp->name, + loglevel = ia->flags & IPV6_AF_NEW ? LOG_INFO : LOG_DEBUG; + logmessage(loglevel, "%s: adding %saddress %s", ifp->name, #ifdef IPV6_AF_TEMPORARY ia->flags & IPV6_AF_TEMPORARY ? "temporary " : "", #else |
