From patchwork Thu Jul 11 10:24:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 2826281 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8C68CC0AB2 for ; Thu, 11 Jul 2013 10:31:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6B53D20181 for ; Thu, 11 Jul 2013 10:31:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CA0320178 for ; Thu, 11 Jul 2013 10:31:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755523Ab3GKKbF (ORCPT ); Thu, 11 Jul 2013 06:31:05 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:39216 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868Ab3GKKbD (ORCPT ); Thu, 11 Jul 2013 06:31:03 -0400 Received: by mail-pd0-f169.google.com with SMTP id y10so7430165pdj.28 for ; Thu, 11 Jul 2013 03:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=SDX7poGW79MlerOpwBln/QE1FzhsiYAaZ6uWOWIRalg=; b=ph14J2YS+4fcrjb+dhY7ATuW1spSeRV8eoAWNDzaw+xMMf30ut8K9U0GwEb/w28ZYZ ExQWPNpkaLr52rlXrl8ZBb9Zho43F2E5tIxxTQ9MzOke2y+CAziXhoU/fAiCz0KYpQxW xMN5ygP9aGaDCHvdigQA/Qh3i/zx0RphlM1SJ1sUKQoWAiSVQvIVphSloLaurrBZNBY/ uIKGALCX4xrhD/+US1Q4cx/r9nZ+0fw6DmjbmFqq4awkXi3NZ9B+eKl444RFw51Zw3qi L+jeWhf+aWLBUuuLDl6qVEEMnwk0q4tnpYb+GLGjhkg57+LWWDCgnmcXWrzAlgSbPAIj qGRQ== X-Received: by 10.68.203.137 with SMTP id kq9mr35718555pbc.190.1373538662915; Thu, 11 Jul 2013 03:31:02 -0700 (PDT) Received: from localhost.localdomain ([58.26.233.146]) by mx.google.com with ESMTPSA id dg3sm39004319pbc.24.2013.07.11.03.30.59 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 03:31:01 -0700 (PDT) From: Chun-Yeow Yeoh To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, linville@tuxdriver.com, devel@lists.open80211s.org, distro11s@cozybit.com, Chun-Yeow Yeoh Subject: [PATCH v2] nl80211: fix the setting of RSSI threshold value for mesh Date: Thu, 11 Jul 2013 18:24:03 +0800 Message-Id: <1373538243-17628-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 RSSI threshold value used for mesh peering should be in negative value. After range checks to mesh parameters is introduced, this is not allowed. Fix this. Signed-off-by: Chun-Yeow Yeoh --- v2: use nla_get_s32 instead (Johannes) net/wireless/nl80211.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index a9444cd..0fc6e3a 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -4803,9 +4803,9 @@ do { \ FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshForwarding, 0, 1, mask, NL80211_MESHCONF_FORWARDING, nla_get_u8); - FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold, 1, 255, + FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold, -255, 0, mask, NL80211_MESHCONF_RSSI_THRESHOLD, - nla_get_u32); + nla_get_s32); FILL_IN_MESH_PARAM_IF_SET(tb, cfg, ht_opmode, 0, 16, mask, NL80211_MESHCONF_HT_OPMODE, nla_get_u16);