I recently noticed that OpenBSD's implementation of 'nc' (netcat),
when run in listen mode, sets SO_REUSEPORT socket option.

This allows binding multiple sockets to the same address. That is one
can run in parallel any number of netcats listening on the same port.

This is nowhere documented, nor any similar utilities set SO_REUSEPORT
by default (I checked: hobbit's netcat, gnu netcat, busybox netcat,
ncat from nmap, and socat.)

Instead, all those tools set the SO_REUSEADDR option. I perceive that
SO_REUSEADDR is commonplace, while SO_REUSEPORT is rather niche.

I wonder if ability to run several netcats listening on same port is
an intentional feature, or an "unintended feature" introduced by
mistaking SO_REUSEPORT for SO_REUSEADDR?

Reply via email to