1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #188 from LudwigOrtmann/native_fix_uninitialized_packet_members

Fix uninitialized packet members
This commit is contained in:
Christian Mehlis 2013-09-04 12:05:01 -07:00
commit afe1015c14
2 changed files with 3 additions and 1 deletions

View File

@ -185,7 +185,7 @@ void _nativenet_handle_packet(radio_packet_t *packet)
/* copy packet to rx buffer */
memcpy(&_nativenet_rx_buffer[rx_buffer_next].data, packet->data, packet->length);
memcpy(&_nativenet_rx_buffer[rx_buffer_next].packet, packet, sizeof(radio_packet_t));
_nativenet_rx_buffer[rx_buffer_next].packet.data = &_nativenet_rx_buffer[rx_buffer_next].data;
_nativenet_rx_buffer[rx_buffer_next].packet.data = (uint8_t *) &_nativenet_rx_buffer[rx_buffer_next].data;
/* notify transceiver thread if any */
if (_native_net_tpid) {

View File

@ -77,6 +77,8 @@ void _native_handle_tap_input(void)
p.length = ntohs(frame.field.payload.nn_header.length);
p.dst = ntohs(frame.field.payload.nn_header.dst);
p.src = ntohs(frame.field.payload.nn_header.src);
p.rssi = 0;
p.lqi = 0;
p.data = frame.field.payload.data;
DEBUG("_native_handle_tap_input: received packet of length %"PRIu16" for %"PRIu16" from %"PRIu16": %s\n", p.length, p.dst, p.src, (char*) p.data);
_nativenet_handle_packet(&p);