From: Guus Sliepen Date: Fri, 6 Mar 2020 23:19:57 +0000 (+0100) Subject: Handle not being able to bind to the configured port at startup. X-Git-Url: http://git.meshlink.io/?a=commitdiff_plain;h=db8e6e4221c974314fd8b05d79dbc94152f01108;hp=db8e6e4221c974314fd8b05d79dbc94152f01108;p=meshlink Handle not being able to bind to the configured port at startup. When starting a MeshLink node that has already been configured to run on a certain port, but that port is in use (for one or more of the supported address families), it would either ignore some address families, or would try to bind to port 0 if all address families failed. However, this is problematic, because it makes discovery and invitation URL generation much harder. Fix this by checking if any port binding fails for a supported address family, and if so, try to find another port that does support binding on all address families. If it fails to find any available port, it will fall back to binding to port 0, so that outgoing connections are still possible. ---