Opened 9 years ago

Last modified 7 years ago

#5631 new Bug

IPv6 DHT dies after sleep/network reconnect on OSX

Reported by: simon.vetter Owned by: livings124
Priority: Normal Milestone: None Set
Component: Mac Client Version: 2.82
Severity: Normal Keywords:


The IPv6 DHT stops working and fails to resume operation when:

  • OSX comes out of sleep,
  • the network connection flaps,
  • the user switches to a different wifi network,
  • the user switches from wired to wifi or the other way around,

while Transmission is running.

A quick tcpdump shows that no UDP packet is being sent by Transmission after wakeup. If the computer slept for long enough, the DHT goes almost immediately to "broken" state. In any case, a restart of Transmission is necessary to get the DHT back to its normal state and discover more peers.

The IPv4 DHT seems to be able to resume normal operation just fine after wakeup.

I've noticed that OSX uses privacy extensions by default and that new addresses are generated whenever an interface link comes up. (which happens after wakeup, when wifi reconnects) Could it be that UDP sockets are bound to a specific IP address, and, if that address is ever removed, the socket won't be able to send anything?

Because new addresses are generated, incoming connections to the old address won't succeed and remote peers won't learn about our new address because it is not announced in the DHT.

This might also affect IPv6 uTP connections, but I haven't been able to confirm it. In my experience, IPv6 TCP connections can be re-established just fine, so I believe that any peer connection would eventually time out and be retried.

With the default sleep timer of 5 mins and without active transfers (or if "Prevent computer to sleep while transfers are active" unchecked), this effectively prevents the IPv6 DHT from operating.

I am using Transmission 2.82 on OSX 10.9.2, PowerNap? is disabled.

Steps to reproduce:

  • Connect OSX to an ipv6-enabled wifi network,
  • Let the ipv6 DHT start its announce, get peers, etc. Notice UDP traffic flowing normally.
  • Disconnect for a minute from the wifi network and reconnect, or put your computer to sleep then wake it up, with transmission running,
  • Notice how the UDP traffic stops and the DHT goes to "broken" state,

Expected behavior:

  • The IPv6 DHT should resume normal operation right after wakeup/reconnect, a restart of Transmission should not be necessary.

Change History (2)

comment:1 Changed 7 years ago by simon.vetter

  • Summary changed from IPv6 DHT (and connections?) doesn't resume after sleep/network reconnect on OSX to IPv6 DHT dies after sleep/network reconnect on OSX
  • Version changed from 2.82 to 2.90

This is still happening with 2.90 on OSX. I have no idea if it happens on other platforms but I suppose it does as Ubuntu also regenerates temporary addresses on wifi reconnect.

Perhaps the easiest way to deal with this would be to restart the DHT, or simply rebind its sockets after a network reconnect event?

comment:2 Changed 7 years ago by mike.dld

  • Version changed from 2.90 to 2.82
Note: See TracTickets for help on using tickets.