path: root/src/l2_packet/l2_packet_none.c
diff options
authorJouni Malinen <j@w1.fi>2014-04-14 20:04:55 (GMT)
committerJouni Malinen <j@w1.fi>2014-04-14 20:04:55 (GMT)
commite47ee249bc8d4f656aee5e6cfc3af14b8a5a0802 (patch)
treec85f0a1bf80411fbeb85852bdaf092f485014b11 /src/l2_packet/l2_packet_none.c
parentcf3f0ec81cb38234a086ea2ccd11c1975eac8505 (diff)
l2_packet: Fix l2_packet_none (hostapd default)
The sample code here ended up trying to register an eloop socket with fd == -1. This was not really ever supposed to be used, but it is now also hitting an assert in eloop. Skip the unnecessary eloop_register_read_sock() to avoid this. This was causing issues for hostapd since CONFIG_L2_PACKET is not set by default. If CONFIG_RSN_PREAUTH=y was not used for CONFIG_L2_PACKET was not set in .config explicitly, the defaul use of l2_packet_none.c ended up hitting the newly added assert() in eloop. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/l2_packet/l2_packet_none.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/src/l2_packet/l2_packet_none.c b/src/l2_packet/l2_packet_none.c
index b01e830..6896c4e 100644
--- a/src/l2_packet/l2_packet_none.c
+++ b/src/l2_packet/l2_packet_none.c
@@ -84,7 +84,8 @@ struct l2_packet_data * l2_packet_init(
* TODO: open connection for receiving frames
l2->fd = -1;
- eloop_register_read_sock(l2->fd, l2_packet_receive, l2, NULL);
+ if (l2->fd >= 0)
+ eloop_register_read_sock(l2->fd, l2_packet_receive, l2, NULL);
return l2;