]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net: ipv6: Add RT6_LOOKUP_F_IFACE flag if oif is set
authorDavid Ahern <dsa@cumulusnetworks.com>
Mon, 28 Sep 2015 17:12:13 +0000 (10:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Sep 2015 22:01:10 +0000 (15:01 -0700)
commit741a11d9e4103a8e1c590ef1280143fe654e4e33
treedc9f842defb7652de2e44ddd852e1c10288e5a52
parent75c261b51ba19f0791de608f0acfb94956f78c76
net: ipv6: Add RT6_LOOKUP_F_IFACE flag if oif is set

Wolfgang reported that IPv6 stack is ignoring oif in output route lookups:

    With ipv6, ip -6 route get always returns the specific route.

    $ ip -6 r
    2001:db8:e2::1 dev enp2s0  proto kernel  metric 256
    2001:db8:e2::/64 dev enp2s0  metric 1024
    2001:db8:e3::1 dev enp3s0  proto kernel  metric 256
    2001:db8:e3::/64 dev enp3s0  metric 1024
    fe80::/64 dev enp3s0  proto kernel  metric 256
    default via 2001:db8:e3::255 dev enp3s0  metric 1024

    $ ip -6 r get 2001:db8:e2::100
    2001:db8:e2::100 from :: dev enp2s0  src 2001:db8:e3::1  metric 0
        cache

    $ ip -6 r get 2001:db8:e2::100 oif enp3s0
    2001:db8:e2::100 from :: dev enp2s0  src 2001:db8:e3::1  metric 0
        cache

The stack does consider the oif but a mismatch in rt6_device_match is not
considered fatal because RT6_LOOKUP_F_IFACE is not set in the flags.

Cc: Wolfgang Nothdurft <netdev@linux-dude.de>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c