Skip to content

Commit

Permalink
mpls: fix clearing of dead nh_flags on link up
Browse files Browse the repository at this point in the history
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: 39eb8cd ("net: mpls: rt_nhn_alive and nh_flags should be accessed using READ_ONCE")
Reported-by: Satish Ashok <[email protected]>
Signed-off-by: Roopa Prabhu <[email protected]>
Acked-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
roopa-prabhu authored and davem330 committed May 31, 2017
1 parent e8f4ae8 commit c2e8471
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mpls/af_mpls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c2e8471

Please sign in to comment.