From ee1df06aabaa8f212eaa7102f6d62cb25bfb35e9 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Fri, 5 Oct 2018 22:22:41 +0100 Subject: [PATCH] Tweak strategy for confirming SLAAC addresses. The code which conirms possible SLAAC addresses associated with hosts known from DHCPv4 addresses keeps trying at longer and longer intervals essentially forever, EXCEPT if sending an ICMP ping results in a HOSTUNREACH error, which terminates the process immediately. It turns out that this is too drastic. Routing changes associated with addressing changes can cause temporary HOSTUNREACH problems, even when an address has not gone forever. Therefore continue trying in the face of HOSTUNREACH for the first part of the process. HOSTUNREACH errors will still terminate the process after it reaches the slow tail of retries. Thanks to Andrey Vakhitov for help diagnosing this. --- src/slaac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slaac.c b/src/slaac.c index 13317d8..3042bb8 100644 --- a/src/slaac.c +++ b/src/slaac.c @@ -166,7 +166,8 @@ time_t periodic_slaac(time_t now, struct dhcp_lease *leases) if (sendto(daemon->icmp6fd, daemon->outpacket.iov_base, save_counter(-1), 0, (struct sockaddr *)&addr, sizeof(addr)) == -1 && - errno == EHOSTUNREACH) + errno == EHOSTUNREACH && + slaac->backoff == 12) slaac->ping_time = 0; /* Give up */ else {