Skip to content

python: only set SO_REUSEPORT on BSD

Stephan Lachnit requested to merge p-python-no-reuseport into main

On Linux SO_REUSEPORT does load balancing (see https://stackoverflow.com/a/14388707), which is not what we want. So if we are not on Linux and SO_REUSEPORT is available, we are on BSD and need to set it. Windows doesn't have it so the existing code would result in a crash on Windows. In C++, asio sets SO_REUSEPORT automatically on BSD if SO_REUSEADDR is set.

Tested on Linux and it (still) works. I haven't tried out if we can actually get CHIRP packages to be dropped due to the load balancing, but in any case we don't want to have it.

Merge request reports

Loading