Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kaspar030
Created January 28, 2019 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaspar030/1b447978ac89cfc77d6be51911e8b305 to your computer and use it in GitHub Desktop.
Save kaspar030/1b447978ac89cfc77d6be51911e8b305 to your computer and use it in GitHub Desktop.
diff --git a/core/msg.c b/core/msg.c
index a46875f16e..dbb6b6b6bf 100644
--- a/core/msg.c
+++ b/core/msg.c
@@ -366,7 +366,7 @@ static int _msg_receive(msg_t *m, int block)
if (sender_prio < THREAD_PRIORITY_IDLE) {
sched_switch(sender_prio);
}
- return 1;
+ return 2;
}
DEBUG("This should have never been reached!\n");
diff --git a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
index feb2e8f10f..a62887c250 100644
--- a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
+++ b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
@@ -180,7 +180,8 @@ static void *_event_loop(void *args)
/* start event loop */
while (1) {
DEBUG("ipv6: waiting for incoming message.\n");
- msg_receive(&msg);
+ memset(&msg, 0, sizeof(msg));
+ int res = msg_receive(&msg);
switch (msg.type) {
case GNRC_NETAPI_MSG_TYPE_RCV:
@@ -220,6 +221,7 @@ static void *_event_loop(void *args)
gnrc_ipv6_nib_handle_timer_event(msg.content.ptr, msg.type);
break;
default:
+ printf("ipv6: unknown message type 0x%04x, res=%i\n", msg.type, res);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment