Subj : Feature request: soft IPv6 force To : All From : Andrei Dzedolik Date : Tue Apr 24 2018 04:13 pm Greetings, travelers ... 20 Apr 18 21:59, Michiel van der Vlist wrote to me: AD>> So, is this statement correct: AD>> 1. Introduce new configuration option for FTN node object to AD>> force IPv6 or IPv4 precedence, disrespecting the OS rules for AD>> this node only; MV> Yep, that is the heart of my feature request. I may need your help here. Again. I have identified the place and way to implement this request: most feasible and elegant from my point of view will be to perform an 'addrinfo' structures list reordering before passing it forward. This could be done in very controlled manner and whole feature this wasy will be activted by compile time option. Now to the tricky part :) One can imagine addrinfo structure list as a list of pre-ordered IP addresses. The 'getaddrinfo' doing this as we know depending on gai.conf settings on somehting similair. In the simpliest case, with standard IPv6 over IPv4 precedence we'll end up with the list of: IPv6 #1 -> ... -> IPv6 #N -> IPv4 #1 -> ... -> IPv4 #N -> NULL Quick and dirty way to reorder it is to find IPv4 #1 and put into the head, then find last IPv4 #N and put it's pointer to the IPv6 #1 and finally IPv6 #N to -> NULL. But ... (remember Ned Stark) ... there is possibiliy, as far as I can read from RFC, the list will be mix of v4 and v6 addresses. So we'll have: IPv6 #1 -> IPv6 #N -> IPv4 #1 ... -> IPv4 #N -> IPv6 #N+1 -> ... -> IPv6 #N+M -> NULL This is possible so far in case IPv4 over IPv6 tunneling has lower precedence, than IPv4, but pure IPv6 is still prefered. Bearing your idea in mind, how should requested feature deal with such lists? p.s. To do not induct your way of thinking I would no post my solution. At least not now :) Cheers, \aID --- GoldED+/BSD 1.1.5-b20170303 * Origin: Hugayda Station (2:463/1331) .