From: KOVACS Krisztian Date: Wed, 1 Oct 2008 14:35:39 +0000 (-0700) Subject: ipv4: Conditionally enable transparent flow flag when connecting X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=79876874ce20d37ecdc7f481ebf142466999152f;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git ipv4: Conditionally enable transparent flow flag when connecting Set FLOWI_FLAG_ANYSRC in flowi->flags if the socket has the transparent socket option set. This way we selectively enable certain connections with non-local source addresses to be routed. Signed-off-by: KOVACS Krisztian Signed-off-by: David S. Miller --- diff --git a/include/net/route.h b/include/net/route.h index 31d1485b624d..4e8cae0e5841 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -161,6 +161,10 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, int err; struct net *net = sock_net(sk); + + if (inet_sk(sk)->transparent) + fl.flags |= FLOWI_FLAG_ANYSRC; + if (!dst || !src) { err = __ip_route_output_key(net, rp, &fl); if (err)