[Pidgin] #15418: network: Add dual stack socket API / fix AF_UNSPEC usage

Pidgin trac at pidgin.im
Wed Aug 20 12:06:29 EDT 2014


#15418: network: Add dual stack socket API / fix AF_UNSPEC usage
--------------------------------------------------+------------------------
 Reporter:  tux                                   |       Owner:
     Type:  patch                                 |      Status:  new
Milestone:  3.0.0                                 |   Component:  libpurple
  Version:  2.10.6                                |  Resolution:
 Keywords:  ipv6 dualstack api network af_unspec  |
--------------------------------------------------+------------------------

Comment (by dohmniq):

 hi - I submitted a similar patch for SIMPLE's simple.c
 [https://developer.pidgin.im/attachment/ticket/16321/simple-address-
 family.patch]

 Comparing it to your patchset above I'm not sure your version will work
 (sorry).

 The case I'm thinking of is when you have Pidgin running on a dual-stack
 machine but connects to an IPv4-only SIP server.

 The call to purple_network_listen_range_dual() will try to create an IPv6
 listen socket. It will probably succeed but of course that socket is
 useless for incoming IPv4 purposes.

 My patch tries to use the same address family as the SIP server's resolved
 hostname.

 It's not perfect either because there are dual-stack SIP servers out
 there. I guess a better solution (e.g. for SIP) would be to try to connect
 with each returned IP address (all families) in turn, starting with IPv6
 ones.

 To do that would add an extra loop around connecting in SIP/SIMPLE module
 for a start - possibly the same for other protocols.

 My laptop is dual-stack but only has a link-local IPv6 address. My SIP
 server is dual-stack but in my case I can only reach it via IPv4 (without
 Teredo). It wouldn't be a problem to try to connect using the link-local
 IPv6 address as long as it switched to IPv4 on failure.

 In fact, if we're really going for it, sometimes my interface has multiple
 IPv6 and multiple IPv4 addresses. Plus there's no reason why a SIP server
 couldn't have multiple IPv6 and multiple IPv4 addresses too (load
 balancing?).

 Maybe use INADDR_ANY once for each address family? But does this cause
 problems with uPnP?

--
Ticket URL: <https://developer.pidgin.im/ticket/15418#comment:2>
Pidgin <https://pidgin.im>
Pidgin


More information about the Tracker mailing list