[PATCH 04/14] Conditionally enable transparent flow flag when connecting

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Miller <davem@...>
Cc: Patrick McHardy <kaber@...>, <netdev@...>
Date: Saturday, October 13, 2007 - 1:31 pm

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>
---

 include/net/route.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/net/route.h b/include/net/route.h
index 88fed3c..9788cc2 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -158,6 +158,10 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
 					 .dport = dport } } };
 
 	int err;
+
+	if (inet_sk(sk)->transparent)
+		fl.flags |= FLOWI_FLAG_ANYSRC;
+
 	if (!dst || !src) {
 		err = __ip_route_output_key(rp, &fl);
 		if (err)

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/14] Transparent Proxying Patches, Take 5, KOVACS Krisztian, (Sat Oct 13, 1:28 pm)
Re: [PATCH 00/14] Transparent Proxying Patches, Take 5, David Miller, (Sat Oct 13, 6:44 pm)
Re: [PATCH 00/14] Transparent Proxying Patches, Take 5, KOVACS Krisztian, (Sun Oct 14, 5:05 am)
[PATCH 07/14] Export UDP socket lookup function, KOVACS Krisztian, (Sat Oct 13, 1:32 pm)
[PATCH 09/14] iptables tproxy core, KOVACS Krisztian, (Sat Oct 13, 1:33 pm)
[PATCH 06/14] Port redirection support for TCP, KOVACS Krisztian, (Sat Oct 13, 1:32 pm)
[PATCH 04/14] Conditionally enable transparent flow flag whe..., KOVACS Krisztian, (Sat Oct 13, 1:31 pm)
[PATCH 05/14] Handle TCP SYN+ACK/ACK/RST transparency, KOVACS Krisztian, (Sat Oct 13, 1:31 pm)
[PATCH 02/14] Implement IP_TRANSPARENT socket option, KOVACS Krisztian, (Sat Oct 13, 1:29 pm)
[PATCH 01/14] Loosen source address check on IPv4 output, KOVACS Krisztian, (Sat Oct 13, 1:29 pm)
[PATCH 14/14] Add documentation, KOVACS Krisztian, (Sat Oct 13, 1:36 pm)
[PATCH 11/14] iptables TPROXY target, KOVACS Krisztian, (Sat Oct 13, 1:34 pm)
[PATCH 10/14] iptables socket match, KOVACS Krisztian, (Sat Oct 13, 1:34 pm)