Simon Goldschmidt wrote:

> That's what I said: "where they are passed to DHCP", not "in dhcp.c"
> (i.e. add a call to your own function in etharp_arp_input() just
> after/before the call to dhcp_arp_reply() - in this function, check
> if the ARP response handles your IP address and react
> appropriately).
> 
> I'd be happy if you could even provide a patch that does this check
> and calls an external function (e.g. etharp_address_collision(netif))
> if such a packet has been received. We could then easily integrate
> that into the stack.

For the record, this is how I solved my problem:

In my port, I defined

void check_address_conflict(struct netif *netif, ip_addr_t *addr)
{
  if (netif->flags & NETIF_FLAG_DHCP) return;
  if (ip_addr_cmp(addr, &netif->ip_addr))
  {
    /* NOTIFY ADDRESS CONFLICT TO END-USER */
  }
}

In etharp_arp_input, I call
check_address_conflict(netif, &sipaddr);
after
dhcp_arp_reply(netif, &sipaddr);


Thanks for pointing me in the right direction, Simon.

-- 
Regards.

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to