Commit 008a7ca2 authored by Robert Lubos's avatar Robert Lubos Committed by Benjamin Cabé
Browse files

net: if: Setup DAD timer regardless of DAD query result

In rare occasions when sending DAD NS packet fails, we should still
setup the DAD timer, unless we implement some kind of more advanced
retry mechanism. If we don't do that, the IPv6 address added to the
interface will never be usable in such cases.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent a09fd8e9
Loading
Loading
Loading
Loading
+6 −2
Changes for subsys/net/ip/net_if.c: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -1298,7 +1298,12 @@ void net_if_ipv6_start_dad(struct net_if *iface,

		ifaddr->dad_count = 1U;

		if (!net_ipv6_start_dad(iface, ifaddr)) {
		if (net_ipv6_start_dad(iface, ifaddr) != 0) {
			NET_ERR("Interface %p failed to send DAD query for %s",
				iface,
				net_sprint_ipv6_addr(&ifaddr->address.in6_addr));
		}

		ifaddr->dad_start = k_uptime_get_32();
		ifaddr->ifindex = net_if_get_by_iface(iface);

@@ -1313,7 +1318,6 @@ void net_if_ipv6_start_dad(struct net_if *iface,
			k_work_reschedule(&dad_timer,
					  K_MSEC(DAD_TIMEOUT));
		}
		}
	} else {
		NET_DBG("Interface %p is down, starting DAD for %s later.",
			iface,