Subj : Feature request: soft IPv6 force To : Andrei Dzedolik From : Michiel van der Vlist Date : Wed Apr 25 2018 10:16 pm Hello Andrei, On Tuesday April 24 2018 16:13, you wrote to All: AD> I may need your help here. Again. I will try... AD> I have identified the place and way to implement this request: most AD> feasible and elegant from my point of view will be to perform an AD> 'addrinfo' structures list reordering before passing it forward. This AD> could be done in very controlled manner and whole feature this wasy AD> will be activted by compile time option. OK. AD> Now to the tricky part :) AD> One can imagine addrinfo structure list as a list of pre-ordered IP AD> addresses. The 'getaddrinfo' doing this as we know depending on AD> gai.conf settings on somehting similair. In the simpliest case, with AD> standard IPv6 over IPv4 precedence we'll end up with the list of: AD> IPv6 #1 -> ... -> IPv6 #N -> IPv4 #1 -> ... -> IPv4 #N -> NULL I must confess I had not yet considered the case of a list of more than one address of each... AD> Quick and dirty way to reorder it is to find IPv4 #1 and put into the AD> head, then find last IPv4 #N and put it's pointer to the IPv6 #1 and AD> finally IPv6 #N to -> NULL. So far so good. AD> But ... (remember Ned Stark) ... there is possibiliy, as far as I can AD> read from RFC, the list will be mix of v4 and v6 addresses. So we'll AD> have: Oh... AD> IPv6 #1 -> IPv6 #N -> IPv4 #1 ... -> IPv4 #N -> IPv6 #N+1 -> ... -> AD> IPv6 #N+M -> NULL AD> This is possible so far in case IPv4 over IPv6 tunneling has lower AD> precedence, than IPv4, but pure IPv6 is still prefered. AD> Bearing your idea in mind, how should requested feature deal with such AD> lists? The reason for asking for a "soft IPv6 force" was to promote IPv6 in Fidonet. Normally IPv6 will be tried first, but in case of tunneling, changing te prefence may be required to have binkd try IPv6 first and then try IPv4 if IPv6 fails. Hence the -64 option. The -46 option was just added for completeness and symmetry. It is not needed for the underlying objective: promote IPv6. So as far as I am concerned I would not mind if only -64 is implemented. If (first entry in the list is IPv6) do nothing; else { find IPv6 #1 in the list; if (not found) do nothing; else move IPv6 #1 to top of list; } This will ensure that IPv6 will be tried first. What happens next when the first IPv6 try fails, does not matter much. Hope this helps. ( Of course adding -46 is just a matter of interchanging IPv6 and IPv4 in the above procedure, but not really important. ) Cheers, Michiel --- GoldED+/W32-MSVC 1.1.5-b20170303 * Origin: http://www.vlist.eu (2:280/5555) .