Wed, 24 Feb 2016 22:22:18 -0800 zeroconf: fix setsockopt() call on Solaris to send payload of correct length
Danek Duvall <danek.duvall@oracle.com> [Wed, 24 Feb 2016 22:22:18 -0800] rev 28249
zeroconf: fix setsockopt() call on Solaris to send payload of correct length The zeroconf extension has been broken on Solaris since the beginning, but no one noticed until the testsuite started poking it after changeset 72f2a19c5f88, when it started running "hg paths" with the extension enabled. Solaris requires that, for IP_MULTICAST_{TTL,LOOP}, the argument passed in be of length 1. With the original code here, it gets passed in as an int -- length 4 -- and so the system call fails with EINVAL. Thankfully, Python's socket.setsockopt() allows you to pass in a string instead of an integer, and it passes that string to libc's setsockopt() with the correct value and length.
(0) -10000 -3000 -1000 -300 -100 -30 -10 -1 +1 +10 +30 +100 +300 +1000 +3000 +10000 tip