From patchwork Fri Jul 6 16:52:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 169505 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]) by ozlabs.org (Postfix) with ESMTP id 5D1622C0084 for ; Sat, 7 Jul 2012 02:54:38 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B70A69C16C; Fri, 6 Jul 2012 12:54:35 -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 Hp5J0TTzPGPr; Fri, 6 Jul 2012 12:54:35 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 6186E9C173; Fri, 6 Jul 2012 12:54:04 -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 31DCC9C173 for ; Fri, 6 Jul 2012 12:54:03 -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 q+ZDW5Q4LXFZ for ; Fri, 6 Jul 2012 12:53:58 -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 46D6C9C16C for ; Fri, 6 Jul 2012 12:53:42 -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 q66Gr3RV016084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 6 Jul 2012 09:53:04 -0700 From: greearb@candelatech.com To: hostap@lists.shmoo.com Subject: [PATCH 5/7] hostap: Ensure netlink recv buf size is large enough. Date: Fri, 6 Jul 2012 09:52:39 -0700 Message-Id: <1341593561-14090-5-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1341593561-14090-1-git-send-email-greearb@candelatech.com> References: <1341593561-14090-1-git-send-email-greearb@candelatech.com> 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 I was getting this error on wpa_supplicant startup when configured for 200+ stations: 1333514002.074458: netlink: recvfrom failed: No buffer space available So, increase rcv buffer size to 1MB so we don't drop netlink packets. Signed-hostap: Ben Greear --- src/drivers/netlink.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/src/drivers/netlink.c b/src/drivers/netlink.c index dd662f3..930acc4 100644 --- a/src/drivers/netlink.c +++ b/src/drivers/netlink.c @@ -92,6 +92,7 @@ struct netlink_data * netlink_init(struct netlink_config *cfg) { struct netlink_data *netlink; struct sockaddr_nl local; + int rsize; netlink = os_zalloc(sizeof(*netlink)); if (netlink == NULL) @@ -118,6 +119,18 @@ struct netlink_data * netlink_init(struct netlink_config *cfg) return NULL; } + /* Set the rcv buffer large so we don't drop netlink messages + * on heavily loaded systems. + */ + rsize = 1024 * 1024; + if (setsockopt(netlink->sock, SOL_SOCKET, SO_RCVBUF, + (char *)&rsize, sizeof(rsize)) < 0) { + wpa_printf(MSG_ERROR, + "netlink: Failed setting rcv buffer to: %i: %s\n", + rsize, strerror(errno)); + /* Not the end of the world..continue */ + } + eloop_register_read_sock(netlink->sock, netlink_receive, netlink, NULL);