summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2015-06-30 11:06:20 +0200
committerSteven Barth <steven@midlink.org>2015-06-30 11:06:20 +0200
commit00c1821a90b45beb31335447dc28853d956d1dbc (patch)
treeb19385628373cb3be454e8d1c4f658a67fd1ba07
parent2ebf6c8216287983779c8ec6597d30893b914a7c (diff)
downloadodhcpd-00c1821a90b45beb31335447dc28853d956d1dbc.tar.gz
ra: keep alive neighbor entries so we can send unicast RAs in the future
-rw-r--r--src/ndp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ndp.c b/src/ndp.c
index 5e8b5ac..5fc95dd 100644
--- a/src/ndp.c
+++ b/src/ndp.c
@@ -212,7 +212,7 @@ int setup_ndp_interface(struct interface *iface, bool enable)
static ssize_t ping6(struct in6_addr *addr,
const struct interface *iface)
{
- struct sockaddr_in6 dest = {AF_INET6, 0, 0, *addr, 0};
+ struct sockaddr_in6 dest = {AF_INET6, 0, 0, *addr, iface->ifindex};
struct icmp6_hdr echo = {.icmp6_type = ICMP6_ECHO_REQUEST};
struct iovec iov = {&echo, sizeof(echo)};
@@ -370,6 +370,11 @@ static void handle_rtnetlink(_unused void *addr, void *data, size_t len,
RTA_PAYLOAD(rta) >= sizeof(*addr))
addr = RTA_DATA(rta);
+ // Keep-alive neighbor entries for RA sending
+ if (nh->nlmsg_type == RTM_DELNEIGH && !(ndm->ndm_state & NUD_FAILED) &&
+ addr && IN6_IS_ADDR_LINKLOCAL(addr) && iface->ra == RELAYD_SERVER)
+ ping6(addr, iface);
+
// Address not specified or unrelated
if (!addr || IN6_IS_ADDR_LINKLOCAL(addr) ||
IN6_IS_ADDR_MULTICAST(addr))