<div dir="ltr"><div><div><div>John,<br><br></div>attached is our patch for spread-src-5.0.0rc1/libspread-<wbr>util/src/data_link.c to avoid setsockopt failing at runtime at Solaris.<br><br></div>This code is running well now on both Solaris and Linux. We use the same parameter style for setsockopt as you did it in the older spread-src-4.4.0/.../data_<wbr>link.c. Concerning Solaris the setsockopt value parameter must be unsigned char or int depending on the kind of option to be set. We don't like and understand this, but apparently it is necessary at Solaris. On the other hand the new code is running well at both Solaris and Linux. So there is no need to make it OS dependent. <br><br></div><div>We would be glad if you could include that patch in your upcoming release.<br><br></div><div>Kind regards,<br></div><div>Martin<br></div><br><div><div><font size="1"><span style="font-family:monospace,monospace">*** libspread-util/src/data_link.<wbr>c.orig    2016-11-22 21:07:12.000000000 +0100<br>--- libspread-util/src/data_link.<wbr>c    2016-12-13 09:32:34.707739959 +0100<br>***************<br>*** 167 ****<br>!  * TODO: check on sizeof setsockopt types across platforms (i.e. - Sun: char vs. int)<br>--- 167 ----<br>!  * DONE: check on sizeof setsockopt types across platforms (i.e. - Sun: char vs. int)<br>***************<br>*** 174 ****<br>--- 175,176 ----<br>+   int           on =1, off =0;<br>+   unsigned char one=1, zero=0;<br>***************<br>*** 176 ****<br>!   Alarmp(SPLOG_INFO, DATA_LINK, "DL_init_channel_gen: creating a SOCK_DGRAM socket of family %d\n", family);<br>--- 178 ----<br>!   Alarmp(SPLOG_INFO, DATA_LINK, "DL_init_channel_gen: 5.0.0-rc1-p1 creating a SOCK_DGRAM socket of family %d\n", family);<br>***************<br>*** 200 ****<br>!       if (setsockopt(chan, SOL_SOCKET, SO_BROADCAST, (tmp = 1, &tmp), sizeof(tmp)))<br>--- 202 ----<br>!       if (setsockopt(chan, SOL_SOCKET, SO_BROADCAST, (char *)&on, sizeof(on)))<br>***************<br>*** 205 ****<br>!       if (setsockopt(chan, IPPROTO_IP, IP_MULTICAST_TTL, (tmp = 1, &tmp), sizeof(tmp))) <br>--- 207 ----<br>!       if (setsockopt(chan, IPPROTO_IP, IP_MULTICAST_TTL, (void *)&one, sizeof(one))) <br>***************<br>*** 213 ****<br>!         if (setsockopt(chan, IPPROTO_IP, IP_MULTICAST_LOOP, (tmp = 0, &tmp), sizeof(tmp)))<br>--- 215 ----<br>!         if (setsockopt(chan, IPPROTO_IP, IP_MULTICAST_LOOP, (void *)&zero, sizeof(zero)))<br>***************<br>*** 221 ****<br>!       if (setsockopt(chan, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (tmp = 1, &tmp), sizeof(tmp))) <br>--- 223 ----<br>!       if (setsockopt(chan, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (void *)&one, sizeof(one))) <br>***************<br>*** 229 ****<br>!         if (setsockopt(chan, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, (tmp = 0, &tmp), sizeof(tmp)))<br>--- 231 ----<br>!         if (setsockopt(chan, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, (void *)&zero, sizeof(zero)))<br>***************<br>*** 243 ****<br>!       if (setsockopt(chan, SOL_SOCKET, SO_BROADCAST, (tmp = 1, &tmp), sizeof(tmp)))<br>--- 245 ----<br>!       if (setsockopt(chan, SOL_SOCKET, SO_BROADCAST, (char *)&on, sizeof(on)))<br>***************<br>*** 254 ****<br>!       if (setsockopt(chan, SOL_SOCKET, SO_REUSEADDR, (tmp = 1, &tmp), sizeof(tmp)))<br>--- 256 ----<br>!       if (setsockopt(chan, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)))<br></span></font><br><br><br><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 8, 2016 at 3:13 PM, John Lane Schultz <span dir="ltr"><<a href="mailto:jschultz@spreadconcepts.com" target="_blank">jschultz@spreadconcepts.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Martin,<br>
<br>
Yes, I am vaguely aware that SunOS expects different sized parameters for options to setsockopt than other platforms but I have no SunOS instance with which to test readily available.<br>
<br>
My hope was that SunOS would have changed to allow larger than expected parameters (e.g. - int) so that the same code was more cross platform.<br>
<br>
If you could take a crack at modifying and testing that bit of code and post the diff here, then I’d appreciate it.  Otherwise, I will try my best (without testing) for the next release candidate.<br>
<br>
Cheers!<br>
<br>
-----<br>
John Lane Schultz<br>
Spread Concepts LLC<br>
Cell: 443 838 2200<br>
<div class="HOEnZb"><div class="h5"><br>
On Dec 8, 2016, at 8:10 AM, Martin Schu <<a href="mailto:martin.sc11111@gmail.com">martin.sc11111@gmail.com</a>> wrote:<br>
<br>
Hi John,<br>
<br>
we are very glad to see the new version, 5.0.0 RC1, of The Spread Toolkit.<br>
Apparently you've not only added IPv6 support but did further polishing, e.g. improved logging and error handling.<br>
<br>
We've tested 5.0.0rc1 in our environment and observed some problems.<br>
<br>
In our Sun/Oracle/Solaris environment spread 5.0.0rc1 fails during startup saying:<br>
"DL_init_channel_gen: problem (22: Invalid argument) in setsockopt of multicast ttl = 1; ignore on Windows"<br>
<br>
In spread-src-5.0.0rc1:libspread-<wbr>util/src/data_link.c you made some comment:<br>
<br>
" * TODO: check on sizeof setsockopt types across platforms (i.e. - Sun: char vs. int)"<br>
<br>
This leads to my assumption that you are aware of that issue, aren't you? Are you planning to fix it?<br>
<br>
Kind regards,<br>
<br>
Martin<br>
<br>
Set Alarm mask to: ffffffff<br>
2016-12-06 14:42:29 GMT Disabling Dangerous Monitor Commands!<br>
2016-12-06 14:42:29 GMT Setting SO_REUSEADDR to auto<br>
2016-12-06 14:42:29 GMT Hash value for this configuration is: 3310648069<br>
2016-12-06 14:42:29 GMT Finished configuration file.<br>
2016-12-06 14:42:29 GMT Conf_load_conf_file: using sin6_scope_id 0 for interface 172.16.0.171<br>
2016-12-06 14:42:29 GMT Conf_load_conf_file: My name: easy-serv-02b, id: 176040470, addr: 172.16.0.171, port: 7982<br>
2016-12-06 14:42:29 GMT E_init: went ok<br>
2016-12-06 14:42:29 GMT new: creating pointer 0x39f7b0 to object type 2 named pack_head<br>
2016-12-06 14:42:29 GMT new: creating pointer 0x385a10 to object type 50 named packet_body<br>
2016-12-06 14:42:29 GMT new: creating pointer 0x39f800 to object type 8 named token_head<br>
2016-12-06 14:42:29 GMT new: creating pointer 0x3a1fb0 to object type 9 named token_body<br>
2016-12-06 14:42:29 GMT new: creating pointer 0x39f850 to object type 8 named token_head<br>
2016-12-06 14:42:29 GMT new: creating pointer 0x385fd0 to object type 50 named packet_body<br>
2016-12-06 14:42:29 GMT Net_signal_conf_reload: Bcast is not needed<br>
2016-12-06 14:42:29 GMT Net_init: implicit: binding bcast recv channel to [0.0.0.0]:7982<br>
2016-12-06 14:42:29 GMT DL_init_channel_gen: creating a SOCK_DGRAM socket of family 2<br>
2016-12-06 14:42:29 GMT DL_init_channel_gen: turning SO_BROADCAST on for recv IPv4 channel<br>
2016-12-06 14:42:29 GMT DL_init_channel_gen: binding recv channel to [0.0.0.0]:7982<br>
2016-12-06 14:42:29 GMT DL_init_channel_gen: success; chan = 4<br>
2016-12-06 14:42:29 GMT Net_init: implicit: binding token recv channel to [0.0.0.0]:7983<br>
2016-12-06 14:42:29 GMT DL_init_channel_gen: creating a SOCK_DGRAM socket of family 2<br>
2016-12-06 14:42:29 GMT DL_init_channel_gen: turning SO_BROADCAST on for recv IPv4 channel<br>
2016-12-06 14:42:29 GMT DL_init_channel_gen: binding recv channel to [0.0.0.0]:7983<br>
2016-12-06 14:42:29 GMT DL_init_channel_gen: success; chan = 5<br>
2016-12-06 14:42:29 GMT Net_init: creating send channel bound to 172.16.0.171<br>
2016-12-06 14:42:29 GMT DL_init_channel_gen: creating a SOCK_DGRAM socket of family 2<br>
2016-12-06 14:42:29 GMT DL_init_channel_gen: turning SO_BROADCAST on for send IPv4 channel<br>
2016-12-06 14:42:29 GMT DL_init_channel_gen: setting IPv4 multicast TTL to 1 for send channel<br>
2016-12-06 14:42:29 GMT DL_init_channel_gen: problem (22: Invalid argument) in setsockopt of multicast ttl = 1; ignore on Windows<br>
Exit caused by Alarm!<br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>