summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
diff options
context:
space:
mode:
authorSergey Nikiforov <Sergey.Nikiforov@kaspersky.com>2020-02-11 11:07:13 +0000
committerRoy Marples <roy@marples.name>2020-02-11 11:07:13 +0000
commitb586bfbfecae8eb425974c9eafd005a04fb2f114 (patch)
tree1d9f9a7baae440790de0ea18bba612acab810036 /src/ipv6.c
parent03cdd9d6a8b3f7de46a9603a2d3007182e369965 (diff)
downloaddhcpcd-b586bfbfecae8eb425974c9eafd005a04fb2f114.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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ipv6.c b/src/ipv6.c
index 0ac9f095..85049554 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -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