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:
parent
f02bc5791a
commit
0df72af04c
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user