From f5a5c5dd2c19356dec58c542bcdd2ef35aa5690f Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 21 Feb 2020 23:55:20 +0100 Subject: [PATCH 1/2] shell/gnrc_icmpv6_echo: fix build with USEMODULE += sock_dns To be able to call sock_dns_query() in _configure(), we also need to include the header file. --- sys/shell/commands/sc_gnrc_icmpv6_echo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/shell/commands/sc_gnrc_icmpv6_echo.c b/sys/shell/commands/sc_gnrc_icmpv6_echo.c index faaaed520d..7241f2635c 100644 --- a/sys/shell/commands/sc_gnrc_icmpv6_echo.c +++ b/sys/shell/commands/sc_gnrc_icmpv6_echo.c @@ -36,6 +36,9 @@ #ifdef MODULE_GNRC_IPV6_NIB #include "net/gnrc/ipv6/nib/nc.h" #endif +#ifdef MODULE_SOCK_DNS +#include "net/sock/dns.h" +#endif #include "net/icmpv6.h" #include "net/ipv6.h" #include "timex.h" From 5256f061dd0c7a5b949daeb49dc9ab0efb5ae34e Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Sat, 22 Feb 2020 00:18:01 +0100 Subject: [PATCH 2/2] tests/gnrc_sock_dns: add a message queue Without it I get the following error when I try to use ping6 !!!! gnrc_netreg: initialize message queue of thread 2 using msg_init_queue() !!!! Stack Pointer: 0x22ef *** RIOT kernel panic: FAILED ASSERTION. So copy the message queue from examples/gnrc_networking --- tests/gnrc_sock_dns/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/gnrc_sock_dns/main.c b/tests/gnrc_sock_dns/main.c index b611c803ca..281516d31d 100644 --- a/tests/gnrc_sock_dns/main.c +++ b/tests/gnrc_sock_dns/main.c @@ -26,6 +26,9 @@ #include "net/sock/dns.h" #include "shell.h" +#define MAIN_QUEUE_SIZE (8) +static msg_t _main_msg_queue[MAIN_QUEUE_SIZE]; + static int _dns(int argc, char **argv); static const shell_command_t _shell_commands[] = { @@ -102,6 +105,10 @@ static int _dns(int argc, char **argv) int main(void) { + /* we need a message queue for the thread running the shell in order to + * receive potentially fast incoming networking packets */ + msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE); + /* start shell */ shell_run(_shell_commands, _shell_buffer, sizeof(_shell_buffer)); return 0;