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 <sashok@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Acked-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Roopa Prabhu authored and David S. Miller 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.