diff options
author | KOVACS Krisztian <hidden@sch.bme.hu> | 2008-10-01 10:44:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-01 10:44:42 -0400 |
commit | 86b08d867d7de001ab224180ed7865fab93fd56e (patch) | |
tree | fc081a9ec0d0107f951cc0270da2865e1e3413e2 /net/ipv4/ip_output.c | |
parent | 88ef4a5a78e63420dd1dd770f1bd1dc198926b04 (diff) |
ipv4: Make Netfilter's ip_route_me_harder() non-local address compatible
Netfilter's ip_route_me_harder() tries to re-route packets either
generated or re-routed by Netfilter. This patch changes
ip_route_me_harder() to handle packets from non-locally-bound sockets
with IP_TRANSPARENT set as local and to set the appropriate flowi
flags when re-doing the routing lookup.
Signed-off-by: KOVACS Krisztian <hidden@sch.bme.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r-- | net/ipv4/ip_output.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index d533a89e08de..d2a8f8bb78a6 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -340,6 +340,7 @@ int ip_queue_xmit(struct sk_buff *skb, int ipfragok) | |||
340 | .saddr = inet->saddr, | 340 | .saddr = inet->saddr, |
341 | .tos = RT_CONN_FLAGS(sk) } }, | 341 | .tos = RT_CONN_FLAGS(sk) } }, |
342 | .proto = sk->sk_protocol, | 342 | .proto = sk->sk_protocol, |
343 | .flags = inet_sk_flowi_flags(sk), | ||
343 | .uli_u = { .ports = | 344 | .uli_u = { .ports = |
344 | { .sport = inet->sport, | 345 | { .sport = inet->sport, |
345 | .dport = inet->dport } } }; | 346 | .dport = inet->dport } } }; |
@@ -1371,7 +1372,8 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar | |||
1371 | .uli_u = { .ports = | 1372 | .uli_u = { .ports = |
1372 | { .sport = tcp_hdr(skb)->dest, | 1373 | { .sport = tcp_hdr(skb)->dest, |
1373 | .dport = tcp_hdr(skb)->source } }, | 1374 | .dport = tcp_hdr(skb)->source } }, |
1374 | .proto = sk->sk_protocol }; | 1375 | .proto = sk->sk_protocol, |
1376 | .flags = ip_reply_arg_flowi_flags(arg) }; | ||
1375 | security_skb_classify_flow(skb, &fl); | 1377 | security_skb_classify_flow(skb, &fl); |
1376 | if (ip_route_output_key(sock_net(sk), &rt, &fl)) | 1378 | if (ip_route_output_key(sock_net(sk), &rt, &fl)) |
1377 | return; | 1379 | return; |