BUG/MINOR: tcp: fix silent-drop workaround for IPv6
authorWilly Tarreau <w@1wt.eu>
Tue, 30 Mar 2021 15:23:50 +0000 (17:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 31 Mar 2021 07:58:54 +0000 (09:58 +0200)
commit0233ce6217abbc515914b3a9da45f64f57859e96
tree86993761e1deed6b1ca96031e749d17a40bd2359
parent25d4248f42ea8989e5470d3a94b29d959ffb29d2
BUG/MINOR: tcp: fix silent-drop workaround for IPv6

As reported in github issue #1203 the TTL-based workaround that is used
when permissions are insufficient for the TCP_REPAIR trick does not work
for IPv6 because we're using only SOL_IP with IP_TTL. In IPv6 we have to
use SOL_IPV6 and IPV6_UNICAST_HOPS. Let's pick the right one based on the
source address's family.

This may be backported to all versions.

(cherry picked from commit ab79ee8b117dbb2c2872747e8119492e70506392)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 64300c5118f0e2cd40ccf1b6aa9d5f19ada0cdc9)
[wt: this is in proto_tcp.c in 2.2]
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 9650f63fb150e0f1c1bcb7012d59eff0ee61a868)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/proto_tcp.c