From patchwork Wed Feb 4 02:22:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 5774241 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0BEBABF440 for ; Wed, 4 Feb 2015 02:22:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 22A0820259 for ; Wed, 4 Feb 2015 02:22:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0FE14201DD for ; Wed, 4 Feb 2015 02:22:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753012AbbBDCWh (ORCPT ); Tue, 3 Feb 2015 21:22:37 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:51345 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751656AbbBDCWg (ORCPT ); Tue, 3 Feb 2015 21:22:36 -0500 Received: by mail-pa0-f54.google.com with SMTP id eu11so104020213pac.13 for ; Tue, 03 Feb 2015 18:22:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z/lScAMA9z8E5hVgLv80CJxOv7lHWd3njjKVnfXri/U=; b=Djj8TYRl4FSCnlL/KqWKSguqWnsHcI4kcvLMHbQOgaD4ATIHV+XIDSJzw0lmB4p3Px D5THQ9VHlrLolvE211E1Q4HEgXYoXE7d86x2WmdhFaVPM6jB3am+8Z1gavU1p1N3WCkU NuxrlrV5vs2RpQ+wJHqJfkbqZnegQ9LzyUVDhYAwyCboel3y+lED6oDMTpYkovWYbpIM USpe7B0id3cA5w2JVcnZhd6Mh5R01vV5t9ZgfuMtQ/5gzkozCedcIjySa37hIKEDW5h6 ipWhV0PV+rStbt36peTrL3yW3wZfdZY9/Bo9smk/1Sp/FMv8OFRe0onVS3uyzbm/xiuS fKXg== X-Received: by 10.70.100.73 with SMTP id ew9mr42548525pdb.95.1423016556517; Tue, 03 Feb 2015 18:22:36 -0800 (PST) Received: from localhost.localdomain (pc667d1.kngwnt01.ap.so-net.ne.jp. [123.198.103.209]) by mx.google.com with ESMTPSA id ul5sm228955pab.36.2015.02.03.18.22.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Feb 2015 18:22:35 -0800 (PST) From: Masashi Honma To: linux-wireless@vger.kernel.org Cc: me@bobcopeland.com, Masashi Honma Subject: [PATCH v4] mac80211: Allow 0 for NL80211_MESHCONF_PLINK_TIMEOUT to disable STA expiration Date: Wed, 4 Feb 2015 11:22:09 +0900 Message-Id: <1423016529-4812-1-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Both wpa_supplicant and mac80211 has inactivity timer. By default wpa_supplicant will be timed out in 5 minutes and mac80211's it is 30 minutes. If wpa_supplicant uses more long timer than mac80211, wpa_supplicant will get unexpected disconnection by mac80211. This patch adds functionality of disabling mac80211 inactivity timer to avoid to prevent wpa_supplicant inactivity timer. I have thought setting 0xffffffff to NL80211_MESHCONF_PLINK_TIMEOUT will solve this problem without this patch. But the approach does not work on 32 bit system. To explain the reason, I will show STA expiration rule in kernel. This is the expression. (current jiffies) > (frame Rx jiffies + NL80211_MESHCONF_PLINK_TIMEOUT * 250) On 32bit system, right side could be over flow and be unexpected small value if NL80211_MESHCONF_PLINK_TIMEOUT is sufficiently large. STA expiration occurs by this reason. So I made this patch. Signed-off-by: Masashi Honma --- net/mac80211/mesh.c | 3 ++- net/wireless/nl80211.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 0c8b2a7..acf441f 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -574,7 +574,8 @@ static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata) struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; u32 changed; - ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * HZ); + if (ifmsh->mshcfg.plink_timeout > 0) + ieee80211_sta_expire(sdata, ifmsh->mshcfg.plink_timeout * HZ); mesh_path_expire(sdata); changed = mesh_accept_plinks_update(sdata); diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index e9ad9d9..bef52af 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -5261,7 +5261,7 @@ do { \ FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshAwakeWindowDuration, 0, 65535, mask, NL80211_MESHCONF_AWAKE_WINDOW, nla_get_u16); - FILL_IN_MESH_PARAM_IF_SET(tb, cfg, plink_timeout, 1, 0xffffffff, + FILL_IN_MESH_PARAM_IF_SET(tb, cfg, plink_timeout, 0, 0xffffffff, mask, NL80211_MESHCONF_PLINK_TIMEOUT, nla_get_u32); if (mask_out)