<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1458096860572_5590"><br></div><div>Hello Michal,</div><div id="yui_3_16_0_1_1458096860572_5643"><br></div><div dir="ltr" id="yui_3_16_0_1_1458096860572_5644">I found a small bug on resolver.c. In function addrlist_resolve, in source line 318 for version 5.31, there is the instruction:</div><div id="yui_3_16_0_1_1458096860572_5729" dir="ltr"><br></div><div id="yui_3_16_0_1_1458096860572_5854" dir="ltr">num+=name2addrlist(addr_list, host->name)</div><div id="yui_3_16_0_1_1458096860572_5856" dir="ltr"><br></div><div id="yui_3_16_0_1_1458096860572_5858" dir="ltr">I think It should be:<br></div><div id="yui_3_16_0_1_1458096860572_6309" dir="ltr"><br></div><div id="yui_3_16_0_1_1458096860572_6311" dir="ltr">num = name2addrlist(addr_list, host->name)<br></div><div id="yui_3_16_0_1_1458096860572_5885" dir="ltr"><br></div><div id="yui_3_16_0_1_1458096860572_5962" dir="ltr">I found this because I created a service with three connect lines, like this:</div><div id="yui_3_16_0_1_1458096860572_6053" dir="ltr"><br></div><div id="yui_3_16_0_1_1458096860572_6108" dir="ltr">[ldaps]<br>client=yes<br>accept=127.0.0.1:7000<br>connect=10.1.1.1:636<br>connect=10.2.2.2:636<br>connect=10.3.2.3:636<br><br></div><div id="yui_3_16_0_1_1458096860572_6107" dir="ltr">And I found this line in the log:<br></div><div id="yui_3_16_0_1_1458096860572_5996" dir="ltr">2016.03.15 22:23:34 LOG6[0]: failover: round-robin, starting at entry #6<br></div><div id="yui_3_16_0_1_1458096860572_6203" dir="ltr"><br></div><div id="yui_3_16_0_1_1458096860572_6205" dir="ltr">#6? It should be <= #2 !</div><div id="yui_3_16_0_1_1458096860572_6207" dir="ltr"><br></div><div id="yui_3_16_0_1_1458096860572_6341" dir="ltr">I checked the source code, added some s_log instructions and found that the problem. For 3 addresses num variable was set to 6 (1 + 2 + 3) and that was returned by addrlist_resolve.</div><div id="yui_3_16_0_1_1458096860572_6215" dir="ltr"><br></div><div id="yui_3_16_0_1_1458096860572_6459" dir="ltr">Hope this helps. And thanks again for your hard work on stunnel.<br></div><div id="yui_3_16_0_1_1458096860572_6378" dir="ltr"><br></div><div id="yui_3_16_0_1_1458096860572_6390" dir="ltr">Best Regards</div><div id="yui_3_16_0_1_1458096860572_6391" dir="ltr"><br></div><div id="yui_3_16_0_1_1458096860572_6393" dir="ltr">Jose A. Diaz</div><div id="yui_3_16_0_1_1458096860572_6392" dir="ltr"><br></div></div></body></html>