1
0
Fork 0
remarkable-linux/net/mpls
David Ahern 42b6d6e824 net: mpls: Fix nexthop alive tracking on down events
[ Upstream commit 61733c91c4 ]

Alive tracking of nexthops can account for a link twice if the carrier
goes down followed by an admin down of the same link rendering multipath
routes useless. This is similar to 79099aab38 for UNREGISTER events and
DOWN events.

Fix by tracking number of alive nexthops in mpls_ifdown similar to the
logic in mpls_ifup. Checking the flags per nexthop once after all events
have been processed is simpler than trying to maintian a running count
through all event combinations.

Also, WRITE_ONCE is used instead of ACCESS_ONCE to set rt_nhn_alive
per a comment from checkpatch:
    WARNING: Prefer WRITE_ONCE(<FOO>, <BAR>) over ACCESS_ONCE(<FOO>) = <BAR>

Fixes: c89359a42e ("mpls: support for dead routes")
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Acked-by: Robert Shearman <rshearma@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-20 10:07:25 +01:00
..
Kconfig mpls: ip tunnel support 2015-07-21 10:39:05 -07:00
Makefile mpls: ip tunnel support 2015-07-21 10:39:05 -07:00
af_mpls.c net: mpls: Fix nexthop alive tracking on down events 2017-12-20 10:07:25 +01:00
internal.h mpls: move mpls_hdr to a common location 2016-10-03 02:00:21 -04:00
mpls_gso.c net: mpls: Fixups for GSO 2016-08-30 22:27:18 -07:00
mpls_iptunnel.c net: Specify the owning module for lwtunnel ops 2017-02-04 09:47:11 +01:00