]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
eloop/poll: Handle POLLER | POLLHUP in read logic
authorBen Greear <greearb@candelatech.com>
Sun, 24 Jun 2012 10:19:34 +0000 (13:19 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 24 Jun 2012 10:19:34 +0000 (13:19 +0300)
Without this, we can get into a tight loop because the
code in general doesn't add eloop exception handlers,
so socket reporting the POLLERR would never be read.

With this change, any socket with POLLERR or POLLHUP
asserted will be handled by the read logic.

Signed-hostap: Ben Greear <greearb@candelatech.com>

src/utils/eloop.c

index 5691f154409565a32af11fa2caa4952f8181f562..b50ea92fc745d9a5e478074e549e8ad1c11f3efb 100644 (file)
@@ -350,7 +350,8 @@ static void eloop_sock_table_dispatch(struct eloop_sock_table *readers,
                                      int max_pollfd_map)
 {
        if (eloop_sock_table_dispatch_table(readers, pollfds_map,
-                                           max_pollfd_map, POLLIN))
+                                           max_pollfd_map, POLLIN | POLLERR |
+                                           POLLHUP))
                return; /* pollfds may be invalid at this point */
 
        if (eloop_sock_table_dispatch_table(writers, pollfds_map,