aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorKOVACS Krisztian <hidden@sch.bme.hu>2008-10-01 10:35:39 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-01 10:35:39 -0400
commit79876874ce20d37ecdc7f481ebf142466999152f (patch)
tree39c23290ceff007d587d4e3b238290570fa4510e /include/net
parent1668e010cbe1a7567c81d4c02d31dde9859e9da1 (diff)
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')
-rw-r--r--include/net/route.h6
1 files changed, 5 insertions, 1 deletions
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 @@
27#include <net/dst.h> 27#include <net/dst.h>
28#include <net/inetpeer.h> 28#include <net/inetpeer.h>
29#include <net/flow.h> 29#include <net/flow.h>
30#include <net/sock.h> 30#include <net/inet_sock.h>
31#include <linux/in_route.h> 31#include <linux/in_route.h>
32#include <linux/rtnetlink.h> 32#include <linux/rtnetlink.h>
33#include <linux/route.h> 33#include <linux/route.h>
@@ -161,6 +161,10 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
161 161
162 int err; 162 int err;
163 struct net *net = sock_net(sk); 163 struct net *net = sock_net(sk);
164
165 if (inet_sk(sk)->transparent)
166 fl.flags |= FLOWI_FLAG_ANYSRC;
167
164 if (!dst || !src) { 168 if (!dst || !src) {
165 err = __ip_route_output_key(net, rp, &fl); 169 err = __ip_route_output_key(net, rp, &fl);
166 if (err) 170 if (err)