znc/znc — pull request #617 by FruitieX (2014-08-07 01:21:08+00:00)
Title: setsockopt IP_FREEBIND

I'm starting ZNC via systemd when my system boots up, and sometimes after bootup I am unable to connect to ZNC even though it's running for a long time. After searching around I found a possible cause, ZNC starts up before my network interfaces are fully configured.

Here I'm enabling the IP_FREEBIND sockopt which should allow binding on addresses that do not yet exist. If anyone else experiences this same issue, can they test with this patch? It seems to have fixed the problem during the last few reboots - but maybe I just got lucky and the network interfaces were configured in time?

Does this seem like something we should use in ZNC? The patch may need to be modified so that it doesn't affect functionality on other platforms. Also I'm not 100% sure this is the correct place to do the setsockopt().