Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ff74a59 authored by YOSHIFUJI Hideaki / 吉藤英明's avatar YOSHIFUJI Hideaki / 吉藤英明 Committed by David S. Miller
Browse files

ndisc: Update neigh->updated with write lock.



neigh->nud_state and neigh->updated are under protection of
neigh->lock.

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cbf1de72
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -499,22 +499,26 @@ static void rt6_probe(struct rt6_info *rt)
	 * to no more than one per minute.
	 */
	neigh = rt ? rt->n : NULL;
	if (!neigh || (neigh->nud_state & NUD_VALID))
	if (!neigh)
		return;
	read_lock_bh(&neigh->lock);
	write_lock_bh(&neigh->lock);
	if (neigh->nud_state & NUD_VALID) {
		write_unlock_bh(&neigh->lock);
		return;
	}
	if (!(neigh->nud_state & NUD_VALID) &&
	    time_after(jiffies, neigh->updated + rt->rt6i_idev->cnf.rtr_probe_interval)) {
		struct in6_addr mcaddr;
		struct in6_addr *target;

		neigh->updated = jiffies;
		read_unlock_bh(&neigh->lock);
		write_unlock_bh(&neigh->lock);

		target = (struct in6_addr *)&neigh->primary_key;
		addrconf_addr_solict_mult(target, &mcaddr);
		ndisc_send_ns(rt->dst.dev, NULL, target, &mcaddr, NULL);
	} else {
		read_unlock_bh(&neigh->lock);
		write_unlock_bh(&neigh->lock);
	}
}
#else