socat rejects TCP-LISTEN on ipv6 only networks#6499
socat rejects TCP-LISTEN on ipv6 only networks#6499neilpang merged 1 commit intoacmesh-official:devfrom
Conversation
if [ "$Le_Listen_V6" ]; then
_NC="$_NC -6"
SOCAT_OPTIONS=TCP6-LISTEN
else
_NC="$_NC -4"
SOCAT_OPTIONS=TCP4-LISTEN
fiI'm just reviewing the code, I got the impression that with this change, in a dual stack it'll never use the IPv6 address unless -6 is explicitly passed on command line. And if it's passed it'll only use IPv6. This change apparently breaks the dual stack in either v4 or v6, not the usual v6 then v4 fallback (one of it will return 'connection refused'). Correct? (I haven't tested, I just got this impression by reading the code) I don't mind much, though I'm only pointing because I'm not sure if this is desired or not (i.e due to a bug in a possibly less common IPv6-only use case, you're breaking the backwards behavior of a probably more common use case that is of a dual stack. What's may be not what you want). Maybe the best, not to break the dual stack fallback would be something like: if [ "$Le_Listen_V6" ]; then
_NC="$_NC -6"
SOCAT_OPTIONS=TCP6-LISTEN
elif [ "$Le_Listen_V4" ]; then
_NC="$_NC -4"
SOCAT_OPTIONS=TCP4-LISTEN
else
SOCAT_OPTIONS=TCP-LISTEN
fi |
|
@vmmello fixed, thanks. |
I figured this issue by trying to run http-01 challenge on a FreeBSD 14 macfine on a IPv6 only environment.
Context
My host is running on Freebsd 14.2 with acme.sh 3.1.1 installed.
I use the following command :
tcpdump show this :
It appears socat is rejecting packets, i have no firewall running on the host.
I found this and this that are related to my problem.
I haven't try the solution of the second link (to rollback to socat 1.7), but instead I propose to support it.
The fix
Just use the
--listen-v6flag to overwrite the socat command with the right options