summaryrefslogtreecommitdiff
path: root/include/net/route.h
diff options
context:
space:
mode:
authorDavid Ahern <dsa@cumulusnetworks.com>2015-10-05 18:51:26 +0300
committerDavid S. Miller <davem@davemloft.net>2015-10-07 14:27:44 +0300
commit8cbb512c923d5f695ff6265b2b741b1718e3b444 (patch)
tree194de9f9c5ec859456dc8274136fcda881dc8408 /include/net/route.h
parent3ce58d84358c7b477811b5100152fad848f936fc (diff)
downloadlinux-8cbb512c923d5f695ff6265b2b741b1718e3b444.tar.xz
net: Add source address lookup op for VRF
Add operation to l3mdev to lookup source address for a given flow. Add support for the operation to VRF driver and convert existing IPv4 hooks to use the new lookup. Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/route.h')
-rw-r--r--include/net/route.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/net/route.h b/include/net/route.h
index 3e18d90b3f4e..ee81307863d5 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -266,9 +266,6 @@ static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32
if (inet_sk(sk)->transparent)
flow_flags |= FLOWI_FLAG_ANYSRC;
- if (netif_index_is_l3_master(sock_net(sk), oif))
- flow_flags |= FLOWI_FLAG_L3MDEV_SRC | FLOWI_FLAG_SKIP_NH_OIF;
-
flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE,
protocol, flow_flags, dst, src, dport, sport);
}
@@ -285,6 +282,10 @@ static inline struct rtable *ip_route_connect(struct flowi4 *fl4,
ip_route_connect_init(fl4, dst, src, tos, oif, protocol,
sport, dport, sk);
+ if (!src && oif) {
+ l3mdev_get_saddr(net, oif, fl4);
+ src = fl4->saddr;
+ }
if (!dst || !src) {
rt = __ip_route_output_key(net, fl4);
if (IS_ERR(rt))