diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-11-05 01:06:28 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-11-05 01:06:28 +0000 |
commit | 4cfb76d4d59acfdadc0f50527533b9c129edde41 (patch) | |
tree | b7a9673379f0dc3bc7800c6693976f6267030dea /nuttx | |
parent | 8a5dadb71ecc3bf8b809b83f9b3f0ffac96c0ca6 (diff) | |
download | px4-nuttx-4cfb76d4d59acfdadc0f50527533b9c129edde41.tar.gz px4-nuttx-4cfb76d4d59acfdadc0f50527533b9c129edde41.tar.bz2 px4-nuttx-4cfb76d4d59acfdadc0f50527533b9c129edde41.zip |
More length-related fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@370 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/net/uip/uip-arp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/nuttx/net/uip/uip-arp.c b/nuttx/net/uip/uip-arp.c index 7a0498c22..9a82943fa 100644 --- a/nuttx/net/uip/uip-arp.c +++ b/nuttx/net/uip/uip-arp.c @@ -287,10 +287,10 @@ void uip_arp_timer(void) #if 0 void uip_arp_ipin(void) { - dev->d_len -= sizeof(struct uip_eth_hdr); - /* Only insert/update an entry if the source IP address of the - incoming IP packet comes from a host on the local network. */ + * incoming IP packet comes from a host on the local network. + */ + if ((IPBUF->eh_srcipaddr & dev->d_netmask) != (dev->d_ipaddr & dev->d_netmask)) { return; @@ -324,7 +324,7 @@ void uip_arp_ipin(void) void uip_arp_arpin(struct uip_driver_s *dev) { in_addr_t ipaddr; - if (dev->d_len < sizeof(struct arp_hdr)) + if (dev->d_len < (sizeof(struct arp_hdr) + UIP_LLH_LEN)) { dev->d_len = 0; return; @@ -359,9 +359,10 @@ void uip_arp_arpin(struct uip_driver_s *dev) ARPBUF->ah_dipaddr[1] = ARPBUF->ah_sipaddr[1]; ARPBUF->ah_sipaddr[0] = dev->d_ipaddr >> 16; ARPBUF->ah_sipaddr[1] = dev->d_ipaddr & 0xffff; + uip_arp_dump(ARPBUF); ETHBUF->type = HTONS(UIP_ETHTYPE_ARP); - dev->d_len = sizeof(struct arp_hdr); + dev->d_len = sizeof(struct arp_hdr) + UIP_LLH_LEN; } break; |