/[lwip]/lwip/src/netif/etharp.c
ViewVC logotype

Diff of /lwip/src/netif/etharp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.89 by likewise, Mon Dec 27 14:50:03 2004 UTC revision 1.90 by likewise, Mon Jan 24 23:02:30 2005 UTC
# Line 431  void Line 431  void
431  etharp_ip_input(struct netif *netif, struct pbuf *p)  etharp_ip_input(struct netif *netif, struct pbuf *p)
432  {  {
433    struct ethip_hdr *hdr;    struct ethip_hdr *hdr;
434      LWIP_ASSERT("netif != NULL", netif != NULL);
435    /* Only insert an entry if the source IP address of the    /* Only insert an entry if the source IP address of the
436       incoming IP packet comes from a host on the local network. */       incoming IP packet comes from a host on the local network. */
437    hdr = p->payload;    hdr = p->payload;
# Line 473  etharp_arp_input(struct netif *netif, st Line 473  etharp_arp_input(struct netif *netif, st
473    u8_t i;    u8_t i;
474    u8_t for_us;    u8_t for_us;
475    
476      LWIP_ASSERT("netif != NULL", netif != NULL);
477      
478    /* drop short ARP packets */    /* drop short ARP packets */
479    if (p->tot_len < sizeof(struct etharp_hdr)) {    if (p->tot_len < sizeof(struct etharp_hdr)) {
480      LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE | 1, ("etharp_arp_input: packet dropped, too short (%d/%d)\n", p->tot_len, sizeof(struct etharp_hdr)));      LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE | 1, ("etharp_arp_input: packet dropped, too short (%d/%d)\n", p->tot_len, sizeof(struct etharp_hdr)));
# Line 554  etharp_arp_input(struct netif *netif, st Line 556  etharp_arp_input(struct netif *netif, st
556      /* ARP reply. We already updated the ARP cache earlier. */      /* ARP reply. We already updated the ARP cache earlier. */
557      LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("etharp_arp_input: incoming ARP reply\n"));      LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("etharp_arp_input: incoming ARP reply\n"));
558  #if (LWIP_DHCP && DHCP_DOES_ARP_CHECK)  #if (LWIP_DHCP && DHCP_DOES_ARP_CHECK)
559      /* When unconfigured, DHCP wants to know about ARP replies from the      /* DHCP wants to know about ARP replies from any host with an
560       * address offered to us, as that means someone else uses it already! */       * IP address also offered to us by the DHCP server. We do not
561      if (netif->ip_addr.addr == 0) dhcp_arp_reply(netif, &sipaddr);       * want to take a duplicate IP address on a single network.
562         * @todo How should we handle redundant (fail-over) interfaces?
563         * */
564        dhcp_arp_reply(netif, &sipaddr);
565  #endif  #endif
566      break;      break;
567    default:    default:

Legend:
Removed from v.1.89  
changed lines
  Added in v.1.90

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26