]> git.baikalelectronics.ru Git - kernel.git/commit
nexthop: Expand nexthop_is_multipath in a few places
authorDavid Ahern <dsahern@gmail.com>
Tue, 26 May 2020 18:56:16 +0000 (12:56 -0600)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 May 2020 23:06:07 +0000 (16:06 -0700)
commit31a8f69f62ede28fad477818f3021c0fa81f8ac3
treedf60d9026c1034aa6fa281f2d7965e99a5fd4cbe
parent3ba0cac7e31a456b2d4575cdee82d13c6b359a05
nexthop: Expand nexthop_is_multipath in a few places

I got too fancy consolidating checks on multipath type. The result
is that path lookups can access 2 different nh_grp structs as exposed
by Nik's torture tests. Expand nexthop_is_multipath within nexthop.h to
avoid multiple, nh_grp dereferences and make decisions based on the
consistent struct.

Only 2 places left using nexthop_is_multipath are within IPv6, both
only check that the nexthop is a multipath for a branching decision
which are acceptable.

Fixes: 6e9d1ef54f91 ("nexthop: Add support for nexthop groups")
Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/nexthop.h