lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] DHCP sends ARP requests with source address of 0.0.0.0 on s


From: R. Diez
Subject: [lwip-users] DHCP sends ARP requests with source address of 0.0.0.0 on start-up
Date: Wed, 7 Jun 2017 14:57:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

Hallo all:

I am upgrading to lwIP 2.0.2 from lwIP 1.4.1.

I noticed that, when the DHCP client gets the IP address, it sends an ARP request, but the source address is 0.0.0.0. Is that the right thing to do? This is the place, see the call to etharp_query() below:


dhcp_check(struct netif *netif)
{
  struct dhcp *dhcp = netif_dhcp_data(netif);
  err_t result;
  u16_t msecs;
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_check(netif=%p) %c%c\n", (void *)netif, (s16_t)netif->name[0],
    (s16_t)netif->name[1]));
  dhcp_set_state(dhcp, DHCP_STATE_CHECKING);
  /* create an ARP query for the offered IP address, expecting that no host
     responds, as the IP address should not be in use. */
  result = etharp_query(netif, &dhcp->offered_ip_addr, NULL);


I would have thought that, if we don't have an IP address yet, there is no point sending an ARP request with a source IP of 0.0.0.0, or is that valid ARP behaviour? This is what it looks like with tshark:


94 169.723097424 MyDevice → Broadcast ARP 60 Who has 169.254.16.27? Tell 0.0.0.0

The reason I noticed is because I am checking that the gratuitous ARP request does get sent correctly in version 2.0.2 too.

The ARP request above seems to remain in the ARP queue, and gets resent a few times afterwards. On those retries, the request looks exactly the same as the gratuitous ARP request. So it seems that lwIP is sending a few gratuitous ARP requests after getting the IP address over DHCP.

I guess it is not that easy to remove the outstanding ARP request from the queue when the DHCP IP address is finally accepted, right?

Is this all worth it? I could just disable DHCP_DOES_ARP_CHECK and be done with it. If the DHCP server offers an address that is already in use, can we actually reject it and request a different one? Or will the DHCP server probably send us the same one again?

Thanks,
  rdiez



reply via email to

[Prev in Thread] Current Thread [Next in Thread]