lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Being notified of an address conflict when setting address


From: Mason
Subject: [lwip-users] Being notified of an address conflict when setting address manually
Date: Fri, 25 May 2012 16:55:56 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120429 Firefox/12.0 SeaMonkey/2.9.1

Hello,

Suppose a user can't use DHCP, and configures his network stack
manually. If he picks an address that is already in use, we might
want to report the problem back to him as soon as possible.

In netif_set_up, we send a "gratuitous ARP" packet. Windows sees
this packet, pops a message to warn about the address conflict,
and sends an ARP reply back to the lwip system.

However, I think lwip ignores this reply, and there is no way
for the lwip system to notify the error to the user.

In etharp.c, etharp_arp_input( ) handles ARP_REPLY packets,
but only in the DHCP case, AFAIU:

  case PP_HTONS(ARP_REPLY):
    /* ARP reply. We already updated the ARP cache earlier. */
    LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_arp_input: incoming ARP 
reply\n"));
#if (LWIP_DHCP && DHCP_DOES_ARP_CHECK)
    /* DHCP wants to know about ARP replies from any host with an
     * IP address also offered to us by the DHCP server. We do not
     * want to take a duplicate IP address on a single network.
     * @todo How should we handle redundant (fail-over) interfaces? */
    dhcp_arp_reply(netif, &sipaddr);
#endif /* (LWIP_DHCP && DHCP_DOES_ARP_CHECK) */
    break;

Maybe we could detect the problem there, and set the interface down?
Then the netif_status callback would be called, and the user could
decide to use a different address?

What is the best strategy here to be notified of a "wrong" choice
for a static address (address already in use).

In the general case, does lwip try to detect when other systems
are using the same IP address?

-- 
Regards.



reply via email to

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