net: Add source address lookup op for VRF
[deliverable/linux.git] / include / net / route.h
index 3e18d90b3f4ed2facd127e43a4374c0217fcf745..ee81307863d56329c097bb3ec30d06b07828b2d0 100644 (file)
@@ -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))
This page took 0.026679 seconds and 5 git commands to generate.