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:
commit
afe1015c14
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user