From patchwork Thu Sep 15 13:52:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16692 X-Patchwork-Delegate: mareklindner@neomailbox.ch Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id EFE0682F37; Thu, 15 Sep 2016 15:53:18 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=bsB4tcIy; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 4364B82F2B for ; Thu, 15 Sep 2016 15:52:59 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p2003007C6F7020FE9422C23834D15380.dip0.t-ipconnect.de [IPv6:2003:7c:6f70:20fe:9422:c238:34d1:5380]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id B1C8A1100B0 for ; Thu, 15 Sep 2016 15:52:58 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1473947578; bh=nE8vVWUlQGW8W4uBSeRyNvnucXCQ8sbktRFug94/c68=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bsB4tcIyLJVakKVVxlyPq2YJeSncpmeXiz4fI2PEwcGaAtyn2horPVncOrvSV9jk5 CdC4SYAbpaVLaLVy5kOOXw57KhhG8yddv3G71CByGcPy38nPphSSbvEvRqgGuNoQMP w1a2WrayiEN8OZ8tj3IrvMmHkjJ9TkfCjh9i4jVg= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 15 Sep 2016 15:52:49 +0200 Message-Id: <20160915135249.1925-3-sven@narfation.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160915135249.1925-1-sven@narfation.org> References: <20160915135249.1925-1-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH next v2 3/3] batman-adv: make netlink attributes const X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" From: stephen hemminger Signed-off-by: Stephen Hemminger [sven@narfation.org: Add compat-patch script] Signed-off-by: Sven Eckelmann --- v2: - new patch picked from the net-next.git compat-patches/replacements.sh | 6 ++++++ net/batman-adv/netlink.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/compat-patches/replacements.sh b/compat-patches/replacements.sh index c7875c0..974aa96 100755 --- a/compat-patches/replacements.sh +++ b/compat-patches/replacements.sh @@ -1,3 +1,9 @@ #! /bin/sh set -e + +# for kernel < 3.13 to make netlink compat code work +sed -i \ + -e 's/^static const struct genl_multicast_group batadv_netlink_mcgrps/static struct genl_multicast_group batadv_netlink_mcgrps/' \ + -e 's/^static const struct nla_policy batadv_netlink_policy/static const struct nla_policy batadv_netlink_policy/' \ + build/net/batman-adv/netlink.c diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c index 18831e7..64cb6ac 100644 --- a/net/batman-adv/netlink.c +++ b/net/batman-adv/netlink.c @@ -62,11 +62,11 @@ enum batadv_netlink_multicast_groups { BATADV_NL_MCGRP_TPMETER, }; -static struct genl_multicast_group batadv_netlink_mcgrps[] = { +static const struct genl_multicast_group batadv_netlink_mcgrps[] = { [BATADV_NL_MCGRP_TPMETER] = { .name = BATADV_NL_MCAST_GROUP_TPMETER }, }; -static struct nla_policy batadv_netlink_policy[NUM_BATADV_ATTR] = { +static const struct nla_policy batadv_netlink_policy[NUM_BATADV_ATTR] = { [BATADV_ATTR_VERSION] = { .type = NLA_STRING }, [BATADV_ATTR_ALGO_NAME] = { .type = NLA_STRING }, [BATADV_ATTR_MESH_IFINDEX] = { .type = NLA_U32 },