mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
6loWPAN: Add IEEE802.15.4 Rime address to union of link layer addresses in the network driver.
This commit is contained in:
@@ -283,7 +283,8 @@ int sixlowpan_queue_frames(FAR struct ieee802154_driver_s *ieee,
|
||||
|
||||
/* Set the source and destinatino address */
|
||||
|
||||
rimeaddr_copy(&g_pktaddrs[PACKETBUF_ADDR_SENDER], &ieee->i_nodeaddr);
|
||||
rimeaddr_copy(&g_pktaddrs[PACKETBUF_ADDR_SENDER],
|
||||
&ieee->i_dev.d_mac.ieee802154);
|
||||
rimeaddr_copy(&g_pktaddrs[PACKETBUF_ADDR_RECEIVER], destmac);
|
||||
|
||||
/* Pre-calculate frame header length. */
|
||||
|
||||
@@ -366,7 +366,8 @@ static void sixlowpan_setup_params(FAR struct ieee802154_driver_s *ieee,
|
||||
|
||||
/* Set the source address to the node address assigned to the device */
|
||||
|
||||
rimeaddr_copy((struct rimeaddr_s *)¶ms->src_addr, &ieee->i_nodeaddr);
|
||||
rimeaddr_copy((struct rimeaddr_s *)¶ms->src_addr,
|
||||
&ieee->i_dev.d_mac.ieee802154);
|
||||
|
||||
/* Use short soruce address mode if so configured */
|
||||
|
||||
|
||||
@@ -614,7 +614,8 @@ void sixlowpan_compresshdr_hc06(FAR struct ieee802154_driver_s *ieee,
|
||||
|
||||
/* Compression compare with this nodes address (source) */
|
||||
|
||||
iphc1 |= compress_addr_64(ipv6->srcipaddr, &ieee->i_nodeaddr,
|
||||
iphc1 |= compress_addr_64(ipv6->srcipaddr,
|
||||
&ieee->i_dev.d_mac.ieee802154,
|
||||
SIXLOWPAN_IPHC_SAM_BIT);
|
||||
}
|
||||
|
||||
@@ -624,7 +625,8 @@ void sixlowpan_compresshdr_hc06(FAR struct ieee802154_driver_s *ieee,
|
||||
ipv6->destipaddr[1] == 0 && ipv6->destipaddr[2] == 0 &&
|
||||
ipv6->destipaddr[3] == 0)
|
||||
{
|
||||
iphc1 |= compress_addr_64(ipv6->srcipaddr, &ieee->i_nodeaddr,
|
||||
iphc1 |= compress_addr_64(ipv6->srcipaddr,
|
||||
&ieee->i_dev.d_mac.ieee802154,
|
||||
SIXLOWPAN_IPHC_SAM_BIT);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -129,7 +129,7 @@ void sixlowpan_compresshdr_hc1(FAR struct ieee802154_driver_s *ieee,
|
||||
|
||||
if (ipv6->vtc != 0x60 || ipv6->tcf != 0 || ipv6->flow != 0 ||
|
||||
!sixlowpan_islinklocal(ipv6->srcipaddr) ||
|
||||
!sixlowpan_ismacbased(ipv6->srcipaddr, &ieee->i_nodeaddr) ||
|
||||
!sixlowpan_ismacbased(ipv6->srcipaddr, &ieee->i_dev.d_mac.ieee802154) ||
|
||||
!sixlowpan_islinklocal(ipv6->destipaddr) ||
|
||||
!sixlowpan_ismacbased(ipv6->destipaddr, destmac) ||
|
||||
(ipv6->proto != IP_PROTO_ICMP6 && ipv6->proto != IP_PROTO_UDP &&
|
||||
|
||||
Reference in New Issue
Block a user