From fe53525416c22d97c3178db53327cbfd84430a63 Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Wed, 11 Mar 2020 12:30:04 +0100 Subject: [PATCH] lwip: amend for async callback argument --- tests/lwip/ip.c | 4 ++-- tests/lwip/tcp.c | 8 ++++---- tests/lwip/udp.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/lwip/ip.c b/tests/lwip/ip.c index 5b5bea7eaa..a5dd320762 100644 --- a/tests/lwip/ip.c +++ b/tests/lwip/ip.c @@ -46,7 +46,7 @@ static msg_t server_msg_queue[SERVER_MSG_QUEUE_SIZE]; static void _ip_recv(sock_ip_t *sock, sock_async_flags_t flags, void *arg) { - (void)arg; + assert(strcmp(arg, "test") == 0); if (flags & SOCK_ASYNC_MSG_RECV) { sock_ip_ep_t src; int res; @@ -90,7 +90,7 @@ static void *_server_thread(void *args) server_running = true; printf("Success: started IP server on protocol %u\n", protocol); event_queue_init(&queue); - sock_ip_event_init(&server_sock, &queue, _ip_recv, NULL); + sock_ip_event_init(&server_sock, &queue, _ip_recv, "test"); event_loop(&queue); return NULL; } diff --git a/tests/lwip/tcp.c b/tests/lwip/tcp.c index ac770e9a30..ee8004e884 100644 --- a/tests/lwip/tcp.c +++ b/tests/lwip/tcp.c @@ -51,7 +51,7 @@ static void _tcp_recv(sock_tcp_t *sock, sock_async_flags_t flags, void *arg) { sock_tcp_ep_t client; - (void)arg; + assert(strcmp(arg, "test") == 0); if (sock_tcp_get_remote(sock, &client) < 0) { /* socket was disconnected between event firing and this handler */ return; @@ -89,7 +89,7 @@ static void _tcp_recv(sock_tcp_t *sock, sock_async_flags_t flags, void *arg) static void _tcp_accept(sock_tcp_queue_t *queue, sock_async_flags_t flags, void *arg) { - (void)arg; + assert(strcmp(arg, "test") == 0); if (flags & SOCK_ASYNC_CONN_RECV) { sock_tcp_t *sock = NULL; int res; @@ -100,7 +100,7 @@ static void _tcp_accept(sock_tcp_queue_t *queue, sock_async_flags_t flags, else { sock_tcp_ep_t client; - sock_tcp_event_init(sock, &_ev_queue, _tcp_recv, NULL); + sock_tcp_event_init(sock, &_ev_queue, _tcp_recv, "test"); sock_tcp_get_remote(sock, &client); #ifdef MODULE_LWIP_IPV6 ipv6_addr_to_str(_addr_str, (ipv6_addr_t *)&client.addr.ipv6, @@ -132,7 +132,7 @@ static void *_server_thread(void *args) printf("Success: started TCP server on port %" PRIu16 "\n", server_addr.port); event_queue_init(&_ev_queue); - sock_tcp_queue_event_init(&server_queue, &_ev_queue, _tcp_accept, NULL); + sock_tcp_queue_event_init(&server_queue, &_ev_queue, _tcp_accept, "test"); event_loop(&_ev_queue); return NULL; } diff --git a/tests/lwip/udp.c b/tests/lwip/udp.c index 39ec1fbe3c..046c6412f4 100644 --- a/tests/lwip/udp.c +++ b/tests/lwip/udp.c @@ -46,7 +46,7 @@ static msg_t server_msg_queue[SERVER_MSG_QUEUE_SIZE]; static void _udp_recv(sock_udp_t *sock, sock_async_flags_t flags, void *arg) { - (void)arg; + assert(strcmp(arg, "test") == 0); if (flags & SOCK_ASYNC_MSG_RECV) { sock_udp_ep_t src; int res; @@ -93,7 +93,7 @@ static void *_server_thread(void *args) printf("Success: started UDP server on port %" PRIu16 "\n", server_addr.port); event_queue_init(&queue); - sock_udp_event_init(&server_sock, &queue, _udp_recv, NULL); + sock_udp_event_init(&server_sock, &queue, _udp_recv, "test"); event_loop(&queue); return NULL; }