diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2019-01-02 21:36:27 +0100 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-01-02 21:41:51 +0100 |
commit | dd1aefd24fa2b23a3f54a327636e06a782248b66 (patch) | |
tree | 2c9e7846acf3905a303170f61e63cf704c434a75 /src | |
parent | 0314d58abefd76b44d4f191e90df2e7a2b09dacb (diff) |
router: add syslog tracing for skipped routes
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/router.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/router.c b/src/router.c index c715757..2f02147 100644 --- a/src/router.c +++ b/src/router.c @@ -359,6 +359,7 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add time_t now = odhcpd_time(); int mtu = iface->ra_mtu; int hlim = iface->ra_hoplimit; + char buf[INET6_ADDRSTRLEN]; if (mtu == 0) mtu = odhcpd_get_interface_config(iface->ifname, "mtu"); @@ -448,11 +449,9 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add uint32_t valid = 0; if (addr->prefix > 96 || addr->valid <= (uint32_t)now) { - char namebuf[INET6_ADDRSTRLEN]; - - inet_ntop(AF_INET6, &addr->addr.in6, namebuf, sizeof(namebuf)); syslog(LOG_INFO, "Address %s (prefix %d, valid %u) not suitable as RA prefix on %s", - namebuf, addr->prefix, addr->valid, iface->ifname); + inet_ntop(AF_INET6, &addr->addr.in6, buf, sizeof(buf)), addr->prefix, + addr->valid, iface->ifname); continue; } @@ -596,8 +595,13 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add for (ssize_t i = 0; i < ipcnt; ++i) { struct odhcpd_ipaddr *addr = &addrs[i]; - if (addr->dprefix > 64 || addr->dprefix == 0 || addr->valid <= (uint32_t)now) + if (addr->dprefix > 64 || addr->dprefix == 0 || addr->valid <= (uint32_t)now) { + syslog(LOG_INFO, "Address %s (dprefix %d, valid %u) not suitable as RA route on %s", + inet_ntop(AF_INET6, &addr->addr.in6, buf, sizeof(buf)), + addr->dprefix, addr->valid, iface->ifname); + continue; /* Address not suitable */ + } if (odhcpd_bmemcmp(&addr->addr, &iface->pio_filter_addr, iface->pio_filter_length) != 0 || |