]> git.baikalelectronics.ru Git - kernel.git/commit
net: Lookup actual route when oif is VRF device
authorDavid Ahern <dsa@cumulusnetworks.com>
Mon, 5 Oct 2015 17:49:04 +0000 (10:49 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Oct 2015 11:31:16 +0000 (04:31 -0700)
commit43ab662a0d80c2dc4b7179b52b6fda36a94bef93
treef545f2206ff791f60b301a70ae0b779e08545e8a
parent1fe58759520df998cd025e8ac20e59d2b38d6513
net: Lookup actual route when oif is VRF device

If the user specifies a VRF device in a get route query the custom route
pointing to the VRF device is returned:

    $ 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 10.2.1.40
    10.2.1.40 dev vrf-red
        cache

Add the flags to skip the custom route and go directly to the FIB. With
this patch the actual route is returned:

    $ ip route get oif vrf-red 10.2.1.40
    10.2.1.40 dev eth1  src 10.2.1.2
        cache

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c