net: Use VRF device index for lookups on TX
[firefly-linux-kernel-4.4.55.git] / include / net / route.h
index 2d45f419477fedadeef42818e7159c148dfd6b84..94189d4bd89902f62d3eb87b474db3ee288dc7a8 100644 (file)
@@ -251,6 +251,9 @@ 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_vrf(sock_net(sk), oif))
+               flow_flags |= FLOWI_FLAG_VRFSRC;
+
        flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE,
                           protocol, flow_flags, dst, src, dport, sport);
 }