Syncoid insecure-remote-connection parameter issues

I’ve been trying to use --insecure-remote-connection with Syncoid over a 10GbE link. I have it working but I experienced some issues with the arguments it passes to busybox nc and mbuffer. I had to tweak the code to make it work.

First, busybox nc. I found that the way Syncoid uses the Busybox nc listener is incorrect. It does busybox nc -l $2 -w $3 but this does not work (I have Busybox 1.36 here). It does work if changed to busybox nc -l -p $2 -w $3 and the second parameter is given as a port number only. I can mirror this behaviour by pasting the relevant (Syncoid-generated) commands into terminals:

$ socat - TCP:192.168.1.11:7000,retry=60,interval=1 # <--- client (sending) side
$ busybox nc -l 7000 -w 60                          # >--- server (receiving side) does not work
$ busybox nc -l -p 7000 -w 60                       # >--- server (receiving side) works
$ nc -l 7000 -w 60                                  # >--- server (receiving side) works

If Syncoid used the regular nc then it would work with the parameters as given.

Secondly, mbuffer. I also found a problem when using mbuffer because it can listen on IPv6 and see the IPv4 address with an IPv6 ::ffff: prefix. This can be fixed by adding -4 to the mbuffer command-line arguments. It also seems that the -4 must precede the -I on the mbuffer command-line. This works: mbuffer -4 -W $3 -I $2 (I previously tried adding -4 to the $mbufferoptions variable but that positioned it after the -I and did not work).

I also tried a command-line like this --insecure-direct-connection 192.168.1.5:7000,::ffff:192.168.1.11:7000,60,mbuffer (with the prefix added) but that gives an error because mbuffer tries to resolve it as a hostname: mbuffer: fatal: could not resolve server hostname: Unknown host.

I am running Arch Linux. I doubt I would be the first to notice this so it may be related to a difference with my setup, though I don’t know what.