From: Roopa Prabhu Date: Wed, 31 May 2017 06:50:36 +0000 (-0700) Subject: mpls: fix clearing of dead nh_flags on link up X-Git-Tag: v4.14-rc1~784^2~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2e8471d98f072f0f18acdd7df5b401ed0d29a2c;p=platform%2Fkernel%2Flinux-rpi.git mpls: fix clearing of dead nh_flags on link up recent fixes to use WRITE_ONCE for nh_flags on link up, accidently ended up leaving the deadflags on a nh. This patch fixes the WRITE_ONCE to use freshly evaluated nh_flags. Fixes: 39eb8cd17588 ("net: mpls: rt_nhn_alive and nh_flags should be accessed using READ_ONCE") Reported-by: Satish Ashok Signed-off-by: Roopa Prabhu Acked-by: David Ahern Signed-off-by: David S. Miller --- diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 257ec66..7b05fd1 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c @@ -1418,7 +1418,7 @@ static void mpls_ifup(struct net_device *dev, unsigned int flags) continue; alive++; nh_flags &= ~flags; - WRITE_ONCE(nh->nh_flags, flags); + WRITE_ONCE(nh->nh_flags, nh_flags); } endfor_nexthops(rt); WRITE_ONCE(rt->rt_nhn_alive, alive);