fix low-level sending destination address

This commit is contained in:
Oleg Hahm 2014-03-09 15:25:23 +00:00
parent 659800d397
commit e879e2aba2
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2013. 2014 INRIA * Copyright (C) 2013, 2014 INRIA
* *
* This file is subject to the terms and conditions of the GNU Lesser * This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level * General Public License v2.1. See the file LICENSE in the top level

View File

@ -256,7 +256,11 @@ int sixlowpan_mac_prepare_ieee802144_frame(
ieee802154_frame_init(frame, (uint8_t *)&lowpan_mac_buf); ieee802154_frame_init(frame, (uint8_t *)&lowpan_mac_buf);
memcpy(&lowpan_mac_buf[hdrlen], frame->payload, frame->payload_len); memcpy(&lowpan_mac_buf[hdrlen], frame->payload, frame->payload_len);
/* set FCS */ /* set FCS */
#ifdef MODULE_CC110X_NG
fcs = (uint16_t *)&lowpan_mac_buf[frame->payload_len + hdrlen+1];
#else
fcs = (uint16_t *)&lowpan_mac_buf[frame->payload_len + hdrlen]; fcs = (uint16_t *)&lowpan_mac_buf[frame->payload_len + hdrlen];
#endif
*fcs = ieee802154_frame_get_fcs(lowpan_mac_buf, frame->payload_len + hdrlen); *fcs = ieee802154_frame_get_fcs(lowpan_mac_buf, frame->payload_len + hdrlen);
DEBUG("IEEE802.15.4 frame - FCF: %02X %02X DPID: %02X SPID: %02X DSN: %02X\n", DEBUG("IEEE802.15.4 frame - FCF: %02X %02X DPID: %02X SPID: %02X DSN: %02X\n",
lowpan_mac_buf[0], lowpan_mac_buf[1], frame->dest_pan_id, lowpan_mac_buf[0], lowpan_mac_buf[1], frame->dest_pan_id,
@ -281,7 +285,7 @@ int sixlowpan_mac_send_data(int if_id,
payload, (size_t)payload_len); payload, (size_t)payload_len);
} }
else if (dest_len == 2) { else if (dest_len == 2) {
return net_if_send_packet(if_id, NTOHS(*((uint16_t *)dest)), return net_if_send_packet(if_id, NTOHS((*((net_if_eui64_t*)dest)).uint16[0]),
payload, (size_t)payload_len); payload, (size_t)payload_len);
} }
} }