diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2015-10-07 08:40:13 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-08 05:18:47 -0700 |
commit | 28335a7445202a3d118145a07d9138e9881ebe18 (patch) | |
tree | 74e8f59a3c75022504fa5e73643af85c8582c58a /net/core/utils.c | |
parent | cfc81b50387086c3a1ca6d2be3c46561edfbc3b5 (diff) |
net: Do not drop to make_route if oif is l3mdev
Commit deaa0a6a930 ("net: Lookup actual route when oif is VRF device")
exposed a bug in __ip_route_output_key_hash for VRF devices: on FIB lookup
failure if the oif is specified the current logic drops to make_route on
the assumption that the route tables are wrong. For VRF/L3 master devices
this leads to wrong dst entries and route lookups. For example:
$ ip route ls table vrf-red
unreachable default
broadcast 10.2.1.0 dev eth1 proto kernel scope link src 10.2.1.2
10.2.1.0/24 dev eth1 proto kernel scope link src 10.2.1.2
local 10.2.1.2 dev eth1 proto kernel scope host src 10.2.1.2
broadcast 10.2.1.255 dev eth1 proto kernel scope link src 10.2.1.2
$ ip route get oif vrf-red 1.1.1.1
1.1.1.1 dev vrf-red src 10.0.0.2
cache
With this patch:
$ ip route get oif vrf-red 1.1.1.1
RTNETLINK answers: No route to host
which is the correct response based on the default route
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/utils.c')
0 files changed, 0 insertions, 0 deletions