tcp: resets are misrouted
authorAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Fri, 12 Oct 2012 04:34:17 +0000 (04:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Oct 2012 17:52:40 +0000 (13:52 -0400)
commit4c67525849e0b7f4bd4fab2487ec9e43ea52ef29
tree9c508670c74b189f45f1b59936234e83aced2eb0
parent5d9d01a30204c99edf99189018953ee84c5f5017
tcp: resets are misrouted

After commit e2446eaa ("tcp_v4_send_reset: binding oif to iif in no
sock case").. tcp resets are always lost, when routing is asymmetric.
Yes, backing out that patch will result in misrouting of resets for
dead connections which used interface binding when were alive, but we
actually cannot do anything here.  What's died that's died and correct
handling normal unbound connections is obviously a priority.

Comment to comment:
> This has few benefits:
>   1. tcp_v6_send_reset already did that.

It was done to route resets for IPv6 link local addresses. It was a
mistake to do so for global addresses. The patch fixes this as well.

Actually, the problem appears to be even more serious than guaranteed
loss of resets.  As reported by Sergey Soloviev <sol@eqv.ru>, those
misrouted resets create a lot of arp traffic and huge amount of
unresolved arp entires putting down to knees NAT firewalls which use
asymmetric routing.

Signed-off-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c