dhcpcd-discuss

Re: dhcpcd ignores offer but dhclient accepts

Roy Marples

Wed May 03 08:59:20 2017

Hi

On 03/05/2017 07:08, Guan Xin wrote:
> I have a problem when connecting to a WiFi AP on an android phone
> without root so it's difficult to debug the dhcp server. It seems that
> after a while (typically a few hours) the IP address acquired with
> dhcpcd is lost. Running dhcpcd -k and then start once more can receive
> the offer, but dhcpcd ignores it:
> 
> -------------------- >8 --------------------
> May 03 07:49:42 dhcpcd-6.11.5 starting
> May 03 07:49:42 wlan1: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
> May 03 07:49:42 wlan1: executing `/lib/dhcpcd/dhcpcd-run-hooks' CARRIER
> May 03 07:49:42 DUID 00:01:00:01:1f:2a:03:f5:08:00:27:ca:e2:7f
> May 03 07:49:42 wlan1: IAID 38:84:28:31
> May 03 07:49:42 wlan1: delaying IPv6 router solicitation for 0.1 seconds
> May 03 07:49:42 wlan1: delaying IPv4 for 0.1 seconds
> May 03 07:49:42 wlan1: soliciting an IPv6 router
> May 03 07:49:42 wlan1: sending Router Solicitation
> May 03 07:49:42 wlan1: soliciting a DHCP lease
> May 03 07:49:42 wlan1: sending DISCOVER (xid 0x5c8e28bd), next in 4.1 seconds
> May 03 07:49:42 wlan1: offered 192.168.43.102 from 192.168.43.1
> May 03 07:49:42 wlan1: sending REQUEST (xid 0x5c8e28bd), next in 3.3 seconds
> May 03 07:49:45 wlan1: sending REQUEST (xid 0x5c8e28bd), next in 7.5 seconds
> May 03 07:49:46 wlan1: sending Router Solicitation
> May 03 07:49:47 wlan1: probing for an IPv4LL address

No, dhcpcd it not ignore it.
dhcpcd sends DISCOVER
dhcp server sends OFFSER
dhcpcd sees this and sends REQUEST
dhcp server ignores REQUEST

> However, dhclient works fine. So how to find out the reason why dhcpcd
> ignored the offer? Thanks in advance!

Collect a tcpdump of what dhclient sends vs dhcpcd.
Some obvious notes:
  *  try swapping duid with clientid or removing both in dhcpcd.conf
  *  try removing option rapid_commit in dhcpcd.conf

This is actually quite odd, because android uses dhcpcd (but an old
version) itself on wifi.

Roy

References:
dhcpcd ignores offer but dhclient acceptsGuan Xin
Archive administrator: postmaster@marples.name