diff options
author | KOVACS Krisztian <hidden@sch.bme.hu> | 2008-10-01 07:35:39 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-01 07:35:39 -0700 |
commit | 79876874ce20d37ecdc7f481ebf142466999152f (patch) | |
tree | 39c23290ceff007d587d4e3b238290570fa4510e /include/net/route.h | |
parent | 1668e010cbe1a7567c81d4c02d31dde9859e9da1 (diff) | |
download | kernel_samsung_espresso10-79876874ce20d37ecdc7f481ebf142466999152f.zip kernel_samsung_espresso10-79876874ce20d37ecdc7f481ebf142466999152f.tar.gz kernel_samsung_espresso10-79876874ce20d37ecdc7f481ebf142466999152f.tar.bz2 |
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 <hidden@sch.bme.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/route.h')
-rw-r--r-- | include/net/route.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/net/route.h b/include/net/route.h index 31d1485..4e8cae0 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -27,7 +27,7 @@ #include <net/dst.h> #include <net/inetpeer.h> #include <net/flow.h> -#include <net/sock.h> +#include <net/inet_sock.h> #include <linux/in_route.h> #include <linux/rtnetlink.h> #include <linux/route.h> @@ -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) |