summaryrefslogtreecommitdiffstats
path: root/src/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2017-04-09 08:44:16 +0100
committerRoy Marples <roy@marples.name>2017-04-09 08:44:16 +0100
commita7544e344dedcd8a97a0252663de8f789404e8fa (patch)
treefd80dab09183fc0bced47d7ab26b7fcd6ef13824 /src/ipv6nd.c
parentce3ea7a52b7246b9ab1131b4030e8b843339c44e (diff)
downloaddhcpcd-a7544e344dedcd8a97a0252663de8f789404e8fa.tar.xz
logerr: errx with logging
Had a few complaints that the lastlog option was dropped. It's now been restored, but with a new way of logging which is the same as errx(3) as found on the BSD platforms but the output also goes to the logging option of choice. This allows the function to define the log priority for syslog and there is no more need to specify %m. In turn, this makes the code needed to write error messages a lot shorter than before. loginfo and logdebug have no optional x suffix because they are not meant to record errors, unlike logerr and logwarn.
Diffstat (limited to 'src/ipv6nd.c')
-rw-r--r--src/ipv6nd.c161
1 files changed, 71 insertions, 90 deletions
diff --git a/src/ipv6nd.c b/src/ipv6nd.c
index d80183dc..1fac6446 100644
--- a/src/ipv6nd.c
+++ b/src/ipv6nd.c
@@ -39,7 +39,6 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
-#include <syslog.h>
#include <unistd.h>
#define ELOOP_QUEUE 3
@@ -50,6 +49,7 @@
#include "if.h"
#include "ipv6.h"
#include "ipv6nd.h"
+#include "logerr.h"
#include "route.h"
#include "script.h"
@@ -268,8 +268,7 @@ ipv6nd_sendrsprobe(void *arg)
struct in6_pktinfo pi;
if (ipv6_linklocal(ifp) == NULL) {
- syslog(LOG_DEBUG,
- "%s: delaying Router Solicitation for LL address",
+ logdebug("%s: delaying Router Solicitation for LL address",
ifp->name);
ipv6_addlinklocalcallback(ifp, ipv6nd_sendrsprobe, ifp);
return;
@@ -282,7 +281,7 @@ ipv6nd_sendrsprobe(void *arg)
#endif
dst.sin6_scope_id = ifp->index;
if (inet_pton(AF_INET6, ALLROUTERS, &dst.sin6_addr) != 1) {
- syslog(LOG_ERR, "%s: %m", __func__);
+ logerr(__func__);
return;
}
@@ -303,10 +302,9 @@ ipv6nd_sendrsprobe(void *arg)
pi.ipi6_ifindex = ifp->index;
memcpy(CMSG_DATA(cm), &pi, sizeof(pi));
- syslog(LOG_DEBUG,
- "%s: sending Router Solicitation", ifp->name);
+ logdebug("%s: sending Router Solicitation", ifp->name);
if (sendmsg(ctx->nd_fd, &ctx->sndhdr, 0) == -1) {
- syslog(LOG_ERR, "%s: %s: sendmsg: %m", ifp->name, __func__);
+ logerr(__func__);
/* Allow IPv6ND to continue .... at most a few errors
* would be logged.
* Generally the error is ENOBUFS when struggling to
@@ -317,7 +315,7 @@ ipv6nd_sendrsprobe(void *arg)
eloop_timeout_add_sec(ifp->ctx->eloop,
RTR_SOLICITATION_INTERVAL, ipv6nd_sendrsprobe, ifp);
else {
- syslog(LOG_WARNING, "%s: no IPv6 Routers available", ifp->name);
+ logwarnx("%s: no IPv6 Routers available", ifp->name);
ipv6nd_drop(ifp);
dhcp6_dropnondelegates(ifp);
}
@@ -364,7 +362,7 @@ ipv6nd_reachable(struct ra *rap, int flags)
if (flags & IPV6ND_REACHABLE) {
if (rap->lifetime && rap->expired) {
- syslog(LOG_INFO, "%s: %s is reachable again",
+ loginfo("%s: %s is reachable again",
rap->iface->name, rap->sfrom);
rap->expired = 0;
rt_build(rap->iface->ctx, AF_INET6);
@@ -373,8 +371,7 @@ ipv6nd_reachable(struct ra *rap, int flags)
}
} else {
if (rap->lifetime && !rap->expired) {
- syslog(LOG_WARNING,
- "%s: %s is unreachable, expiring it",
+ logwarnx("%s: %s is unreachable, expiring it",
rap->iface->name, rap->sfrom);
rap->expired = 1;
rt_build(rap->iface->ctx, AF_INET6);
@@ -513,7 +510,7 @@ rtpref(struct ra *rap)
case ND_RA_FLAG_RTPREF_LOW:
return (RTPREF_LOW);
default:
- syslog(LOG_ERR, "rtpref: impossible RA flag %x", rap->flags);
+ logerrx("rtpref: impossible RA flag %x", rap->flags);
return (RTPREF_INVALID);
}
/* NOTREACHED */
@@ -554,8 +551,7 @@ ipv6nd_scriptrun(struct ra *rap)
IN6_IFF_TENTATIVE))
ap->flags |= IPV6_AF_DADCOMPLETED;
if ((ap->flags & IPV6_AF_DADCOMPLETED) == 0) {
- syslog(LOG_DEBUG,
- "%s: waiting for Router Advertisement"
+ logdebug("%s: waiting for Router Advertisement"
" DAD to complete",
rap->iface->name);
return 0;
@@ -578,7 +574,7 @@ ipv6nd_scriptrun(struct ra *rap)
#if 0
else if (options & DHCPCD_DAEMONISE &&
!(options & DHCPCD_DAEMONISED) && new_data)
- syslog(LOG_WARNING, "%s: did not fork due to an absent"
+ logwarnx("%s: did not fork due to an absent"
" RDNSS option in the RA",
ifp->name);
}
@@ -630,8 +626,7 @@ ipv6nd_dadcallback(void *arg)
ap->flags |= IPV6_AF_DADCOMPLETED;
if (ap->flags & IPV6_AF_DUPLICATED) {
ap->dadcounter++;
- syslog(LOG_WARNING, "%s: DAD detected %s",
- ifp->name, ap->saddr);
+ logwarnx("%s: DAD detected %s", ifp->name, ap->saddr);
/* Try and make another stable private address.
* Because ap->dadcounter is always increamented,
@@ -639,24 +634,22 @@ ipv6nd_dadcallback(void *arg)
/* XXX Cache DAD counter per prefix/id/ssid? */
if (ifp->options->options & DHCPCD_SLAACPRIVATE) {
if (ap->dadcounter >= IDGEN_RETRIES) {
- syslog(LOG_ERR, "%s: unable to obtain a"
+ logerrx("%s: unable to obtain a"
" stable private address",
ifp->name);
goto try_script;
}
- syslog(LOG_INFO, "%s: deleting address %s",
+ loginfo("%s: deleting address %s",
ifp->name, ap->saddr);
if (if_address6(RTM_DELADDR, ap) == -1 &&
errno != EADDRNOTAVAIL && errno != ENXIO)
- syslog(LOG_ERR, "if_address6: %m");
+ logerr(__func__);
dadcounter = ap->dadcounter;
if (ipv6_makestableprivate(&ap->addr,
&ap->prefix, ap->prefix_len,
ifp, &dadcounter) == -1)
{
- syslog(LOG_ERR,
- "%s: ipv6_makestableprivate: %m",
- ifp->name);
+ logerr("ipv6_makestableprivate");
return;
}
ap->dadcounter = dadcounter;
@@ -700,8 +693,8 @@ try_script:
}
if (wascompleted && found) {
- syslog(LOG_DEBUG,
- "%s: Router Advertisement DAD completed",
+ logdebug("%s: Router Advertisement DAD "
+ "completed",
rap->iface->name);
if (ipv6nd_scriptrun(rap))
return;
@@ -741,38 +734,39 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
struct ipv6_addr *ap;
struct dhcp_opt *dho;
uint8_t new_rap, new_data;
+ __printflike(1, 2) void (*logfunc)(const char *, ...);
#ifdef IPV6_MANAGETEMPADDR
uint8_t new_ap;
#endif
if (ifp == NULL) {
#ifdef DEBUG_RS
- syslog(LOG_DEBUG, "RA for unexpected interface from %s",
+ logdebug("RA for unexpected interface from %s",
ctx->sfrom);
#endif
return;
}
if (len < sizeof(struct nd_router_advert)) {
- syslog(LOG_ERR, "IPv6 RA packet too short from %s", ctx->sfrom);
+ logerr("IPv6 RA packet too short from %s", ctx->sfrom);
return;
}
/* RFC 4861 7.1.2 */
if (hoplimit != 255) {
- syslog(LOG_ERR, "invalid hoplimit(%d) in RA from %s",
+ logerr("invalid hoplimit(%d) in RA from %s",
hoplimit, ctx->sfrom);
return;
}
if (!IN6_IS_ADDR_LINKLOCAL(&ctx->from.sin6_addr)) {
- syslog(LOG_ERR, "RA from non local address %s", ctx->sfrom);
+ logerr("RA from non local address %s", ctx->sfrom);
return;
}
if (!(ifp->options->options & DHCPCD_IPV6RS)) {
#ifdef DEBUG_RS
- syslog(LOG_DEBUG, "%s: unexpected RA from %s",
+ logerr("%s: unexpected RA from %s",
ifp->name, ctx->sfrom);
#endif
return;
@@ -781,14 +775,14 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
/* We could receive a RA before we sent a RS*/
if (ipv6_linklocal(ifp) == NULL) {
#ifdef DEBUG_RS
- syslog(LOG_DEBUG, "%s: received RA from %s (no link-local)",
+ logdebug("%s: received RA from %s (no link-local)",
ifp->name, ctx->sfrom);
#endif
return;
}
if (ipv6_iffindaddr(ifp, &ctx->from.sin6_addr, IN6_IFF_TENTATIVE)) {
- syslog(LOG_DEBUG, "%s: ignoring RA from ourself %s",
+ logdebug("%s: ignoring RA from ourself %s",
ifp->name, ctx->sfrom);
return;
}
@@ -816,7 +810,7 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
if (rap == NULL) {
rap = calloc(1, sizeof(*rap));
if (rap == NULL) {
- syslog(LOG_ERR, "%s: %m", __func__);
+ logerr(__func__);
return;
}
rap->iface = ifp;
@@ -829,7 +823,7 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
if (rap->data_len == 0) {
rap->data = malloc(len);
if (rap->data == NULL) {
- syslog(LOG_ERR, "%s: %m", __func__);
+ logerr(__func__);
if (new_rap)
free(rap);
return;
@@ -842,8 +836,8 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
* routers like to decrease the advertised valid and preferred times
* in accordance with the own prefix times which would result in too
* much needless log spam. */
- syslog(new_rap ? LOG_INFO : LOG_DEBUG,
- "%s: Router Advertisement from %s",
+ logfunc = new_rap ? loginfo : logdebug,
+ logfunc("%s: Router Advertisement from %s",
ifp->name, ctx->sfrom);
clock_gettime(CLOCK_MONOTONIC, &rap->acquired);
@@ -869,17 +863,17 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
p = ((uint8_t *)icp) + sizeof(struct nd_router_advert);
for (; len > 0; p += olen, len -= olen) {
if (len < sizeof(ndo)) {
- syslog(LOG_ERR, "%s: short option", ifp->name);
+ logerrx("%s: short option", ifp->name);
break;
}
memcpy(&ndo, p, sizeof(ndo));
olen = (size_t)ndo.nd_opt_len * 8;
if (olen == 0) {
- syslog(LOG_ERR, "%s: zero length option", ifp->name);
+ logerrx("%s: zero length option", ifp->name);
break;
}
if (olen > len) {
- syslog(LOG_ERR, "%s: option length exceeds message",
+ logerrx("%s: option length exceeds message",
ifp->name);
break;
}
@@ -895,12 +889,10 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
break;
}
if (dho != NULL)
- syslog(LOG_WARNING,
- "%s: reject RA (option %s) from %s",
+ logwarnx("%s: reject RA (option %s) from %s",
ifp->name, dho->var, ctx->sfrom);
else
- syslog(LOG_WARNING,
- "%s: reject RA (option %d) from %s",
+ logwarnx("%s: reject RA (option %d) from %s",
ifp->name, ndo.nd_opt_type, ctx->sfrom);
if (new_rap)
ipv6nd_removefreedrop_ra(rap, 0, 0);
@@ -914,17 +906,15 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
switch (ndo.nd_opt_type) {
case ND_OPT_PREFIX_INFORMATION:
+ logfunc = new_data ? logerrx : logdebug;
if (ndo.nd_opt_len != 4) {
- syslog(new_data ? LOG_ERR : LOG_DEBUG,
- "%s: invalid option len for prefix",
+ logfunc("%s: invalid option len for prefix",
ifp->name);
continue;
}
memcpy(&pi, p, sizeof(pi));
if (pi.nd_opt_pi_prefix_len > 128) {
- syslog(new_data ? LOG_ERR : LOG_DEBUG,
- "%s: invalid prefix len",
- ifp->name);
+ logfunc("%s: invalid prefix len", ifp->name);
continue;
}
/* nd_opt_pi_prefix is not aligned. */
@@ -933,15 +923,13 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
if (IN6_IS_ADDR_MULTICAST(&pi_prefix) ||
IN6_IS_ADDR_LINKLOCAL(&pi_prefix))
{
- syslog(new_data ? LOG_ERR : LOG_DEBUG,
- "%s: invalid prefix in RA", ifp->name);
+ logfunc("%s: invalid prefix in RA", ifp->name);
continue;
}
if (ntohl(pi.nd_opt_pi_preferred_time) >
ntohl(pi.nd_opt_pi_valid_time))
{
- syslog(new_data ? LOG_ERR : LOG_DEBUG,
- "%s: pltime > vltime", ifp->name);
+ logfunc("%s: pltime > vltime", ifp->name);
continue;
}
TAILQ_FOREACH(ap, &rap->addrs, next)
@@ -955,8 +943,10 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
ND_OPT_PI_FLAG_ONLINK))
continue;
ap = calloc(1, sizeof(*ap));
- if (ap == NULL)
+ if (ap == NULL) {
+ logerr(__func__);
break;
+ }
ap->iface = rap->iface;
ap->flags = IPV6_AF_NEW;
ap->prefix_len = pi.nd_opt_pi_prefix_len;
@@ -1034,8 +1024,7 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
if (new_ap && ap->prefix_pltime) {
if (ipv6_createtempaddr(ap,
&ap->acquired) == NULL)
- syslog(LOG_ERR,
- "ipv6_createtempaddr: %m");
+ logerr("ipv6_createtempaddr");
}
}
#endif
@@ -1045,7 +1034,7 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
memcpy(&mtu, p, sizeof(mtu));
mtu.nd_opt_mtu_mtu = ntohl(mtu.nd_opt_mtu_mtu);
if (mtu.nd_opt_mtu_mtu < IPV6_MMTU) {
- syslog(LOG_ERR, "%s: invalid MTU %d",
+ logerrx("%s: invalid MTU %d",
ifp->name, mtu.nd_opt_mtu_mtu);
break;
}
@@ -1070,8 +1059,7 @@ ipv6nd_handlera(struct dhcpcd_ctx *ctx, struct interface *ifp,
if (has_option_mask(ifp->options->requiremasknd,
dho->option))
{
- syslog(LOG_WARNING,
- "%s: reject RA (no option %s) from %s",
+ logwarnx("%s: reject RA (no option %s) from %s",
ifp->name, dho->var, ctx->sfrom);
if (new_rap)
ipv6nd_removefreedrop_ra(rap, 0, 0);
@@ -1110,20 +1098,19 @@ handle_flag:
goto nodhcp6;
/* Only log a DHCPv6 start error if compiled in or debugging is enabled. */
#ifdef DHCP6
-#define LOG_DHCP6 LOG_ERR
+#define LOG_DHCP6 logerr
#else
-#define LOG_DHCP6 LOG_DEBUG
+#define LOG_DHCP6 logdebug
#endif
if (rap->flags & ND_RA_FLAG_MANAGED) {
if (new_data && dhcp6_start(ifp, DH6S_INIT) == -1)
- syslog(LOG_DHCP6, "dhcp6_start: %s: %m", ifp->name);
+ LOG_DHCP6("dhcp6_start: %s", ifp->name);
} else if (rap->flags & ND_RA_FLAG_OTHER) {
if (new_data && dhcp6_start(ifp, DH6S_INFORM) == -1)
- syslog(LOG_DHCP6, "dhcp6_start: %s: %m", ifp->name);
+ LOG_DHCP6("dhcp6_start: %s", ifp->name);
} else {
if (new_data)
- syslog(LOG_DEBUG, "%s: No DHCPv6 instruction in RA",
- ifp->name);
+ logdebug("%s: No DHCPv6 instruction in RA", ifp->name);
nodhcp6:
if (ifp->ctx->options & DHCPCD_TEST) {
eloop_exit(ifp->ctx->eloop, EXIT_SUCCESS);
@@ -1354,8 +1341,7 @@ ipv6nd_expirera(void *arg)
if (rap->lifetime == 0 || timespeccmp(&now, &expire, >))
{
if (!rap->expired) {
- syslog(LOG_WARNING,
- "%s: %s: router expired",
+ logwarnx("%s: %s: router expired",
ifp->name, rap->sfrom);
rap->expired = expired = 1;
rap->lifetime = 0;
@@ -1381,14 +1367,12 @@ ipv6nd_expirera(void *arg)
timespecadd(&ia->acquired, &lt, &expire);
if (timespeccmp(&now, &expire, >)) {
if (ia->flags & IPV6_AF_ADDED) {
- syslog(LOG_WARNING,
- "%s: expired address %s",
+ logwarnx("%s: expired address %s",
ia->iface->name, ia->saddr);
if (if_address6(RTM_DELADDR, ia)== -1 &&
errno != EADDRNOTAVAIL &&
errno != ENXIO)
- syslog(LOG_ERR,
- "if_address6: %m");
+ logerr(__func__);
}
ia->prefix_vltime = ia->prefix_pltime = 0;
ia->flags &=
@@ -1471,21 +1455,21 @@ ipv6nd_handlena(struct dhcpcd_ctx *ctx, struct interface *ifp,
if (ifp == NULL) {
#ifdef DEBUG_NS
- syslog(LOG_DEBUG, "NA for unexpected interface from %s",
+ logdebug("NA for unexpected interface from %s",
ctx->sfrom);
#endif
return;
}
if ((size_t)len < sizeof(struct nd_neighbor_advert)) {
- syslog(LOG_ERR, "%s: IPv6 NA too short from %s",
+ logerrx("%s: IPv6 NA too short from %s",
ifp->name, ctx->sfrom);
return;
}
/* RFC 4861 7.1.2 */
if (hoplimit != 255) {
- syslog(LOG_ERR, "invalid hoplimit(%d) in NA from %s",
+ logerrx("invalid hoplimit(%d) in NA from %s",
hoplimit, ctx->sfrom);
return;
}
@@ -1499,7 +1483,7 @@ ipv6nd_handlena(struct dhcpcd_ctx *ctx, struct interface *ifp,
/* nd_na->nd_na_target is not aligned. */
memcpy(&nd_na_target, &nd_na->nd_na_target, sizeof(nd_na_target));
if (IN6_IS_ADDR_MULTICAST(&nd_na_target)) {
- syslog(LOG_ERR, "%s: NA multicast address %s (%s)",
+ logerrx("%s: NA multicast address %s (%s)",
ifp->name, taddr, ctx->sfrom);
return;
}
@@ -1511,20 +1495,20 @@ ipv6nd_handlena(struct dhcpcd_ctx *ctx, struct interface *ifp,
}
if (rap == NULL) {
#ifdef DEBUG_NS
- syslog(LOG_DEBUG, "%s: unexpected NA from %s for %s",
+ logdebug("%s: unexpected NA from %s for %s",
ifp->name, ctx->sfrom, taddr);
#endif
return;
}
#ifdef DEBUG_NS
- syslog(LOG_DEBUG, "%s: %sNA for %s from %s",
+ logdebug("%s: %sNA for %s from %s",
ifp->name, is_solicited ? "solicited " : "", taddr, ctx->sfrom);
#endif
/* Node is no longer a router, so remove it from consideration */
if (!is_router && !rap->expired) {
- syslog(LOG_INFO, "%s: %s not a router (%s)",
+ loginfo("%s: %s not a router (%s)",
ifp->name, taddr, ctx->sfrom);
rap->expired = 1;
rt_build(ifp->ctx, AF_INET6);
@@ -1535,7 +1519,7 @@ ipv6nd_handlena(struct dhcpcd_ctx *ctx, struct interface *ifp,
if (is_solicited && is_router && rap->lifetime) {
if (rap->expired) {
rap->expired = 0;
- syslog(LOG_INFO, "%s: %s reachable (%s)",
+ loginfo("%s: %s reachable (%s)",
ifp->name, taddr, ctx->sfrom);
rt_build(ifp->ctx, AF_INET6);
script_runreason(rap->iface, "ROUTERADVERT"); /* XXX */
@@ -1559,7 +1543,7 @@ ipv6nd_handledata(void *arg)
CMSG_SPACE(sizeof(int));
len = recvmsg_realloc(ctx->nd_fd, &ctx->rcvhdr, 0);
if (len == -1) {
- syslog(LOG_ERR, "recvmsg: %m");
+ logerr(__func__);
eloop_event_delete(ctx->eloop, ctx->nd_fd);
close(ctx->nd_fd);
ctx->nd_fd = -1;
@@ -1568,8 +1552,7 @@ ipv6nd_handledata(void *arg)
ctx->sfrom = inet_ntop(AF_INET6, &ctx->from.sin6_addr,
ctx->ntopbuf, INET6_ADDRSTRLEN);
if ((size_t)len < sizeof(struct icmp6_hdr)) {
- syslog(LOG_ERR, "IPv6 ICMP packet too short from %s",
- ctx->sfrom);
+ logerrx("IPv6 ICMP packet too short from %s", ctx->sfrom);
return;
}
@@ -1594,8 +1577,7 @@ ipv6nd_handledata(void *arg)
}
if (pkt.ipi6_ifindex == 0) {
- syslog(LOG_ERR, "IPv6 RA/NA did not contain index from %s",
- ctx->sfrom);
+ logerrx("IPv6 RA/NA did not contain index from %s", ctx->sfrom);
return;
}
@@ -1622,7 +1604,7 @@ ipv6nd_handledata(void *arg)
}
}
- syslog(LOG_ERR, "invalid IPv6 type %d or code %d from %s",
+ logerrx("invalid IPv6 type %d or code %d from %s",
icp->icmp6_type, icp->icmp6_code, ctx->sfrom);
}
@@ -1632,9 +1614,9 @@ ipv6nd_startrs1(void *arg)
struct interface *ifp = arg;
struct rs_state *state;
- syslog(LOG_INFO, "%s: soliciting an IPv6 router", ifp->name);
+ loginfo("%s: soliciting an IPv6 router", ifp->name);
if (ipv6nd_open(ifp->ctx) == -1) {
- syslog(LOG_ERR, "%s: ipv6nd_open: %m", __func__);
+ logerr(__func__);
return;
}
@@ -1643,7 +1625,7 @@ ipv6nd_startrs1(void *arg)
ifp->if_data[IF_DATA_IPV6ND] = calloc(1, sizeof(*state));
state = RS_STATE(ifp);
if (state == NULL) {
- syslog(LOG_ERR, "%s: %m", __func__);
+ logerr(__func__);
return;
}
}
@@ -1652,7 +1634,7 @@ ipv6nd_startrs1(void *arg)
* address could have changed. */
ipv6nd_makersprobe(ifp);
if (state->rs == NULL) {
- syslog(LOG_ERR, "%s: ipv6ns_makersprobe: %m", __func__);
+ logerr(__func__);
return;
}
@@ -1675,8 +1657,7 @@ ipv6nd_startrs(struct interface *ifp)
tv.tv_nsec = (suseconds_t)arc4random_uniform(
MAX_RTR_SOLICITATION_DELAY * NSEC_PER_SEC);
timespecnorm(&tv);
- syslog(LOG_DEBUG,
- "%s: delaying IPv6 router solicitation for %0.1f seconds",
+ logdebug("%s: delaying IPv6 router solicitation for %0.1f seconds",
ifp->name, timespec_to_double(&tv));
eloop_timeout_add_tv(ifp->ctx->eloop, &tv, ipv6nd_startrs1, ifp);
return;