From patchwork Fri Mar 30 21:35:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 149758 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 5003FB6ED0 for ; Sat, 31 Mar 2012 08:35:46 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id CC9D99D234; Fri, 30 Mar 2012 17:35:44 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wKcu3T87FDNr; Fri, 30 Mar 2012 17:35:44 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 8CA919D238; Fri, 30 Mar 2012 17:35:40 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 533E89D238 for ; Fri, 30 Mar 2012 17:35:39 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QBIb8EMw4ieM for ; Fri, 30 Mar 2012 17:35:34 -0400 (EDT) Received: from ns3.lanforge.com (mail.candelatech.com [208.74.158.172]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 558929D234 for ; Fri, 30 Mar 2012 17:35:34 -0400 (EDT) Received: from fs3.candelatech.com (firewall.candelatech.com [70.89.124.249]) by ns3.lanforge.com (8.14.2/8.14.2) with ESMTP id q2ULZTGx011699 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Mar 2012 14:35:30 -0700 From: greearb@candelatech.com To: hostap@lists.shmoo.com Subject: [PATCH] eloop/poll: Handle POLLER | POLLHUP in read logic. Date: Fri, 30 Mar 2012 14:35:04 -0700 Message-Id: <1333143304-27495-1-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 1.7.3.4 Cc: Ben Greear X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Ben Greear 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 --- :100644 100644 5691f15... 9f64314... M src/utils/eloop.c src/utils/eloop.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/utils/eloop.c b/src/utils/eloop.c index 5691f15..9f64314 100644 --- a/src/utils/eloop.c +++ b/src/utils/eloop.c @@ -350,7 +350,7 @@ 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,