From patchwork Mon Dec 1 15:53:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arik Nemtsov X-Patchwork-Id: 5413301 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8FA5C9F319 for ; Mon, 1 Dec 2014 15:53:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3CF62014A for ; Mon, 1 Dec 2014 15:53:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E069B200F4 for ; Mon, 1 Dec 2014 15:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753961AbaLAPxv (ORCPT ); Mon, 1 Dec 2014 10:53:51 -0500 Received: from mail-wg0-f41.google.com ([74.125.82.41]:42151 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753947AbaLAPxu (ORCPT ); Mon, 1 Dec 2014 10:53:50 -0500 Received: by mail-wg0-f41.google.com with SMTP id y19so14577539wgg.0 for ; Mon, 01 Dec 2014 07:53:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=j7ag31JHVHX5y2u3XhfQERF7h0XgLs7w7VIywGNq7Ac=; b=c4gWnS7Hat34TTt/tbzit1d12naoY0PY6xhE7rH0rVrlbnHAwd0oIES8TgCGdqaOP/ TA3LZcU6JxnhKfUOvETtMxYZYI2oOHx3L0Fzhhd3/UW5BVvnWf03CkAxgWXWUbdNx1tA P0/IlrTWLbju118dLfJVby8Z13crDuMjfvHPjRIha2617w4U7VokA4Qrp8+xPiIQBOP4 FNnP3JRJcSI4fo9EaRxDWAZDagmVVmS48UaY5VggyVMu8D0xk+C55la2XBU9yspGPgTr B9ZwfyzHD0nP1ItlOH0hbBT4mYlzpHdaqdHuSc6qwI1Pw/88aYeijFMuokTXftH6xgWS Wnzg== X-Gm-Message-State: ALoCoQmyJXbtDgJMYHAkKwgZYicQNkf3B/JfhTb06HXUOyQrxThRIJMVEs5Fj87UGSQzy2M817Eh X-Received: by 10.180.186.40 with SMTP id fh8mr85925770wic.40.1417449229118; Mon, 01 Dec 2014 07:53:49 -0800 (PST) Received: from athena.amr.corp.intel.com (85-250-108-142.bb.netvision.net.il. [85.250.108.142]) by mx.google.com with ESMTPSA id rx8sm28101207wjb.30.2014.12.01.07.53.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Dec 2014 07:53:48 -0800 (PST) From: Arik Nemtsov To: Cc: Johannes Berg , "Luis R. Rodriguez" , Arik Nemtsov Subject: [PATCH v2 3/4] iw: fix attr max for reg_rule Date: Mon, 1 Dec 2014 17:53:43 +0200 Message-Id: <1417449224-10293-3-git-send-email-arik@wizery.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417449224-10293-1-git-send-email-arik@wizery.com> References: <1417449224-10293-1-git-send-email-arik@wizery.com> 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Signed-off-by: Arik Nemtsov --- reg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reg.c b/reg.c index 9af8e7e..a02c982 100644 --- a/reg.c +++ b/reg.c @@ -127,7 +127,7 @@ static int print_reg_handler(struct nl_msg *msg, void *arg) struct nlattr *nl_rule; int rem_rule; enum nl80211_dfs_regions dfs_domain; - static struct nla_policy reg_rule_policy[NL80211_FREQUENCY_ATTR_MAX + 1] = { + static struct nla_policy reg_rule_policy[NL80211_REG_RULE_ATTR_MAX + 1] = { [NL80211_ATTR_REG_RULE_FLAGS] = { .type = NLA_U32 }, [NL80211_ATTR_FREQ_RANGE_START] = { .type = NLA_U32 }, [NL80211_ATTR_FREQ_RANGE_END] = { .type = NLA_U32 }, @@ -159,10 +159,10 @@ static int print_reg_handler(struct nl_msg *msg, void *arg) printf("country %c%c: %s\n", alpha2[0], alpha2[1], dfs_domain_name(dfs_domain)); nla_for_each_nested(nl_rule, tb_msg[NL80211_ATTR_REG_RULES], rem_rule) { - struct nlattr *tb_rule[NL80211_FREQUENCY_ATTR_MAX + 1]; + struct nlattr *tb_rule[NL80211_REG_RULE_ATTR_MAX + 1]; __u32 flags, start_freq_khz, end_freq_khz, max_bw_khz, max_ant_gain_mbi, max_eirp_mbm; - nla_parse(tb_rule, NL80211_FREQUENCY_ATTR_MAX, nla_data(nl_rule), nla_len(nl_rule), reg_rule_policy); + nla_parse(tb_rule, NL80211_REG_RULE_ATTR_MAX, nla_data(nl_rule), nla_len(nl_rule), reg_rule_policy); flags = nla_get_u32(tb_rule[NL80211_ATTR_REG_RULE_FLAGS]); start_freq_khz = nla_get_u32(tb_rule[NL80211_ATTR_FREQ_RANGE_START]);