Skip to content

Commit

Permalink
Merge pull request #188 from LudwigOrtmann/native_fix_uninitialized_p…
Browse files Browse the repository at this point in the history
…acket_members

Fix uninitialized packet members
  • Loading branch information
mehlis committed Sep 4, 2013
2 parents 5ecfb4c + b3a8fdc commit afe1015
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cpu/native/net/interface.c
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions cpu/native/net/tap.c
Expand Up @@ -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);
Expand Down

0 comments on commit afe1015

Please sign in to comment.