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.
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users