mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:17:13 +08:00
6LoWPAN: Correct an error in calculating the location of the UDP header.
This commit is contained in:
@@ -68,13 +68,6 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_NET_6LOWPAN_COMPRESSION_HC06
|
#ifdef CONFIG_NET_6LOWPAN_COMPRESSION_HC06
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#define UDPIPv6BUF(ieee) \
|
|
||||||
((FAR struct udp_hdr_s *)&((ieee)->i_dev.d_buf[IPv6_HDRLEN]))
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -760,9 +753,12 @@ void sixlowpan_compresshdr_hc06(FAR struct ieee802154_driver_s *ieee,
|
|||||||
|
|
||||||
if (ipv6->proto == IP_PROTO_UDP)
|
if (ipv6->proto == IP_PROTO_UDP)
|
||||||
{
|
{
|
||||||
FAR struct udp_hdr_s *udp = UDPIPv6BUF(ieee);
|
/* The UDP header will follow the IPv6 header */
|
||||||
|
|
||||||
ninfo("Uncompressed UDP ports on send side: %x, %x\n",
|
FAR struct udp_hdr_s *udp =
|
||||||
|
(FAR struct udp_hdr_s *)((FAR uint8_t *)ipv6 + IPv6_HDRLEN);
|
||||||
|
|
||||||
|
ninfo("Uncompressed UDP ports on send side: srcport=%04x destport=%04x\n",
|
||||||
ntohs(udp->srcport), ntohs(udp->destport));
|
ntohs(udp->srcport), ntohs(udp->destport));
|
||||||
|
|
||||||
/* Mask out the last 4 bits can be used as a mask */
|
/* Mask out the last 4 bits can be used as a mask */
|
||||||
|
|||||||
Reference in New Issue
Block a user