aboutsummaryrefslogtreecommitdiffstats
path: root/src/l2_packet/l2_packet_none.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2020-04-19 13:36:47 (GMT)
committerJouni Malinen <j@w1.fi>2020-04-19 14:42:41 (GMT)
commit7a880b129de8f439324ab0c04a20417af022a29c (patch)
tree60ab3e80a54782ab19baa962b8fef8a234681323 /src/l2_packet/l2_packet_none.c
parent95cbf450909abd4e45793c479d8e0d00618d3618 (diff)
downloadhostap-7a880b129de8f439324ab0c04a20417af022a29c.zip
hostap-7a880b129de8f439324ab0c04a20417af022a29c.tar.gz
hostap-7a880b129de8f439324ab0c04a20417af022a29c.tar.bz2
l2_packet: Allow initialization without RX handling
This can be used to minimize resource use when receive path is not needed. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/l2_packet/l2_packet_none.c')
-rw-r--r--src/l2_packet/l2_packet_none.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/l2_packet/l2_packet_none.c b/src/l2_packet/l2_packet_none.c
index 307fc6d..bc7a4e8 100644
--- a/src/l2_packet/l2_packet_none.c
+++ b/src/l2_packet/l2_packet_none.c
@@ -84,7 +84,7 @@ struct l2_packet_data * l2_packet_init(
* TODO: open connection for receiving frames
*/
l2->fd = -1;
- if (l2->fd >= 0)
+ if (rx_callback && l2->fd >= 0)
eloop_register_read_sock(l2->fd, l2_packet_receive, l2, NULL);
return l2;
@@ -112,7 +112,7 @@ void l2_packet_deinit(struct l2_packet_data *l2)
eloop_unregister_read_sock(l2->fd);
/* TODO: close connection */
}
-
+
os_free(l2);
}