summaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorDavid Ahern <dsa@cumulusnetworks.com>2015-08-13 14:59:02 -0600
committerDavid S. Miller <davem@davemloft.net>2015-08-13 22:43:20 -0700
commit613d09b30f8b589d5a9b49775054c8865db95d1c (patch)
tree93178a4839a7caaca7b9318bc2736dc1c5676859 /net/ipv4/route.c
parentcd2fbe1b6b517ca7c0e80b103c674fdf5bd50f76 (diff)
downloadop-kernel-dev-613d09b30f8b589d5a9b49775054c8865db95d1c.zip
op-kernel-dev-613d09b30f8b589d5a9b49775054c8865db95d1c.tar.gz
net: Use VRF device index for lookups on TX
As with ingress use the index of VRF master device for route lookups on egress. However, the oif should only be used to direct the lookups to a specific table. Routes in the table are not based on the VRF device but rather interfaces that are part of the VRF so do not consider the oif for lookups within the table. The FLOWI_FLAG_VRFSRC is used to control this latter part. Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com> Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index c26ff1f..2c89d29 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2131,6 +2131,11 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4)
fl4->saddr = inet_select_addr(dev_out, 0,
RT_SCOPE_HOST);
}
+ if (netif_is_vrf(dev_out) &&
+ !(fl4->flowi4_flags & FLOWI_FLAG_VRFSRC)) {
+ rth = vrf_dev_get_rth(dev_out);
+ goto out;
+ }
}
if (!fl4->daddr) {
OpenPOWER on IntegriCloud