netfilter: TCP and raw fix for ip_route_me_harder
commit797fd3913abf2f7036003ab8d3d019cbea41affd
authorJulian Anastasov <ja@ssi.bg>
Sun, 7 Aug 2011 09:11:00 +0000 (7 09:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Aug 2011 05:52:32 +0000 (7 22:52 -0700)
treea2e6aee9a92754f11f33bab4e8f9deed3ffb94bf
parent6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
netfilter: TCP and raw fix for ip_route_me_harder

TCP in some cases uses different global (raw) socket
to send RST and ACK. The transparent flag is not set there.
Currently, it is a problem for rerouting after the previous
change.

Fix it by simplifying the checks in ip_route_me_harder
and use FLOWI_FLAG_ANYSRC even for sockets. It looks safe
because the initial routing allowed this source address to
be used and now we just have to make sure the packet is rerouted.

As a side effect this also allows rerouting for normal
raw sockets that use spoofed source addresses which was not possible
even before we eliminated the ip_route_input call.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/netfilter.c