dhcpcd-discuss

Re: porting dhcpv6 to android

Roy Marples

Fri May 17 23:15:04 2013

On 14/05/2013 6:56, Roy Marples wrote:
Hi Jayce

On 13/05/2013 17:04, jayce lee wrote:
I have recreate the 3rd bug in my ubuntu laptop. 
I first disconnected my wifi connection and run dhcpcd wlan0 with the
console shows as follows:

sudo ./dhcpcd wlan0
dhcpcd[17431]: version 5.99.4 starting
dhcpcd[17431]: wlan0: waiting for carrier

Then I connect my wifi and the bug appears

 dhcpcd[17431]: wlan0: carrier acquired
dhcpcd[17431]: wlan0: soliciting DHCPv6 address
dhcpcd[17431]: wlan0: rebinding lease of 192.168.0.108
dhcpcd[17431]: wlan0: sendmsg: Cannot assign requested address (Errno 99)
dhcpcd[17431]: wlan0: deleting address 2002:1234:5678:9abc::253/64
dhcpcd[17431]: del_address6 Cannot assign requested address
dhcpcd[17431]: wlan0: acknowledged 192.168.0.108 from 192.168.0.1
dhcpcd[17431]: wlan0: checking for 192.168.0.108
dhcpcd[17431]: wlan0: leased 192.168.0.108 for 86400 seconds

Perhaps it's a common bug not only in android.

So the problem here is that we need to send from the IPv6 link local
address on the interface, but at the point of the error it either
doesn't exist yet or it's in the tentative state which means we can't
use it until DAD completes.

I think we need to handle this specific error gracefully and add code
to if-linux.c and if-bsd.c to listen for IPv6 addresses to become
available and react accordingly.

This has now been fixed here:
http://roy.marples.name/cgi-bin/gitweb.cgi?p=dhcpcd.git;a=commitdiff;h=5f4a495851bdbe4c0098ece90f3a9d945cf9f735

There maybe a failure still if getifaddrs(3) reports tentative addresses, but I've not been able to verify that.
However, it now works as you reported on my Debian machine.

Thanks

Roy

References:
porting dhcpv6 to androidjayce lee
Re: porting dhcpv6 to androidRoy Marples
Re: porting dhcpv6 to androidRoy Marples
Archive administrator: postmaster@marples.name