Skip to content

Automatically disable inet6 transport if ipv6 is disabled on machine

Ray Strode requested to merge halfline/libxtrans:ipv6-disable-fix into master

If a machine is booted with ipv6.disable=1, trying to bind to an AF_INET6 socket will fail with AFNOSUPPORT.

The tcp transport automatically falls back to ipv4 in this case, but the more specific inet6 transport just fails.

This failure leads to MakeAllCOTSServerListeners returning a partial success.

Unfortunately, the X server can't really contiue with partial successes from this function if -displayfd is in use, since that would, in other cases, potentially lead to the -displayfd electing a display number that is potentially partially in use by a rogue program.

This commit addresses the issue by automatically disabling transports when they fail with AFNOSUPPORT, leading them to get ignored, rather than proceeding and ultimately returning from MakeAllCOTSServerListerns with partial=TRUE.

Merge request reports