diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-11-05 00:14:42 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-11-05 00:14:42 +0000 |
commit | 8a5dadb71ecc3bf8b809b83f9b3f0ffac96c0ca6 (patch) | |
tree | f0a14d428be8c564a52a66dff7e81f6783e55122 /nuttx/net | |
parent | 83705d736e7e957752226de8c2165aa9ff4deeaa (diff) | |
download | px4-nuttx-8a5dadb71ecc3bf8b809b83f9b3f0ffac96c0ca6.tar.gz px4-nuttx-8a5dadb71ecc3bf8b809b83f9b3f0ffac96c0ca6.tar.bz2 px4-nuttx-8a5dadb71ecc3bf8b809b83f9b3f0ffac96c0ca6.zip |
Fix problem with ARP request message length
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@369 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net')
-rw-r--r-- | nuttx/net/uip/uip-arp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/nuttx/net/uip/uip-arp.c b/nuttx/net/uip/uip-arp.c index 49bb24879..7a0498c22 100644 --- a/nuttx/net/uip/uip-arp.c +++ b/nuttx/net/uip/uip-arp.c @@ -487,7 +487,7 @@ void uip_arp_out(struct uip_driver_s *dev) ETHBUF->type = HTONS(UIP_ETHTYPE_ARP); dev->d_appdata = &dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN]; - dev->d_len = sizeof(struct arp_hdr); + dev->d_len = sizeof(struct arp_hdr) + UIP_LLH_LEN; return; } @@ -495,9 +495,10 @@ void uip_arp_out(struct uip_driver_s *dev) memcpy(ETHBUF->dest, tabptr->at_ethaddr.addr, IFHWADDRLEN); } - memcpy(ETHBUF->src, dev->d_mac.addr, IFHWADDRLEN); - ETHBUF->type = HTONS(UIP_ETHTYPE_IP); + /* Finish populating the ethernet header */ - dev->d_len += sizeof(struct uip_eth_hdr); + memcpy(ETHBUF->src, dev->d_mac.addr, IFHWADDRLEN); + ETHBUF->type = HTONS(UIP_ETHTYPE_IP); + dev->d_len += UIP_LLH_LEN; } |