1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/lwip: add missing initialization for async_cb

Without initializing async_cb to NULL it might be a value != NULL,
which leads to sock->async_cb.gen() being called mistakenly in _netconn_cb.

gnrc_sock already does it with "reg->async_cb.generic = NULL;"
This commit is contained in:
Hendrik van Essen 2021-12-31 03:47:42 +01:00 committed by Hendrik van Essen
parent f02bc5791a
commit 0df72af04c
2 changed files with 2 additions and 0 deletions

View File

@ -45,6 +45,7 @@ int sock_ip_create(sock_ip_t *sock, const sock_ip_ep_t *local,
NETCONN_RAW)) == 0) {
sock->base.conn = tmp;
#if IS_ACTIVE(SOCK_HAS_ASYNC)
sock->base.async_cb.gen = NULL;
netconn_set_callback_arg(sock->base.conn, &sock->base);
#endif
}

View File

@ -41,6 +41,7 @@ int sock_udp_create(sock_udp_t *sock, const sock_udp_ep_t *local,
NETCONN_UDP)) == 0) {
sock->base.conn = tmp;
#if IS_ACTIVE(SOCK_HAS_ASYNC)
sock->base.async_cb.gen = NULL;
netconn_set_callback_arg(sock->base.conn, &sock->base);
#endif
}