X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fodhcpd.git;a=blobdiff_plain;f=src%2Fndp.c;h=02c2dbd89164b96c2c352df3d3300bf1bffc9695;hp=89bcd3c98af43fc92958fc8f055f45e6ff3e926e;hb=b228e0f242d5ae7f3976215bdb20c1e65be1cd40;hpb=8b19de666e02f24280728938dd985ecb3673b83e diff --git a/src/ndp.c b/src/ndp.c index 89bcd3c..02c2dbd 100644 --- a/src/ndp.c +++ b/src/ndp.c @@ -160,10 +160,19 @@ int setup_ndp_interface(struct interface *iface, bool enable) if (iface->static_ndp_len) { char *entry = alloca(iface->static_ndp_len), *saveptr; + if (!entry) { + syslog(LOG_ERR, "Alloca failed for static NDP list"); + return -1; + } memcpy(entry, iface->static_ndp, iface->static_ndp_len); for (entry = strtok_r(entry, " ", &saveptr); entry; entry = strtok_r(NULL, " ", &saveptr)) { struct ndp_neighbor *n = malloc(sizeof(*n)); + if (!n) { + syslog(LOG_ERR, "Malloc failed for static NDP-prefix %s", entry); + return -1; + } + n->iface = iface; n->timeout = 0; @@ -225,7 +234,7 @@ static void handle_solicit(void *addr, void *data, size_t len, char ipbuf[INET6_ADDRSTRLEN]; inet_ntop(AF_INET6, &req->nd_ns_target, ipbuf, sizeof(ipbuf)); - syslog(LOG_NOTICE, "Got a NS for %s", ipbuf); + syslog(LOG_DEBUG, "Got a NS for %s", ipbuf); uint8_t mac[6]; odhcpd_get_mac(iface, mac); @@ -237,7 +246,7 @@ static void handle_solicit(void *addr, void *data, size_t len, struct ndp_neighbor *n = find_neighbor(&req->nd_ns_target, false); if (n && (n->iface || abs(n->timeout - now) < 5)) { - syslog(LOG_NOTICE, "%s is on %s", ipbuf, + syslog(LOG_DEBUG, "%s is on %s", ipbuf, (n->iface) ? n->iface->ifname : ""); if (!n->iface || n->iface == iface) return; @@ -525,8 +534,8 @@ static void handle_rtnetlink(_unused void *addr, void *data, size_t len, /* TODO: See if this is required for optimal operation // Keep neighbor entries alive so we don't loose routes + */ if (add && (ndm->ndm_state & NUD_STALE)) ping6(addr, iface); - */ } }