From patchwork Wed Apr 4 05:06:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 150596 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 42565B6FEA for ; Wed, 4 Apr 2012 15:07:04 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id E73739D25C; Wed, 4 Apr 2012 01:07:02 -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 Tiohhck48E17; Wed, 4 Apr 2012 01:07:02 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id E23D89D27F; Wed, 4 Apr 2012 01:06:58 -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 CC22C9D27F for ; Wed, 4 Apr 2012 01:06:57 -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 tRLa7qXFvULt for ; Wed, 4 Apr 2012 01:06:53 -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 F05A59D25C for ; Wed, 4 Apr 2012 01:06:52 -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 q3456meh003626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 Apr 2012 22:06:48 -0700 From: greearb@candelatech.com To: hostap@lists.shmoo.com Subject: [PATCH] hostap: Ensure netlink recv buf size is large enough. Date: Tue, 3 Apr 2012 22:06:45 -0700 Message-Id: <1333516005-28168-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 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 Signed-off-by: Ben Greear --- :100644 100644 dd662f3... 930acc4... M src/drivers/netlink.c 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);