From patchwork Sun Oct 9 06:57:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16726 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 CCB7882461; Sun, 9 Oct 2016 08:58:03 +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=ZcaaJ3mT; 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 17D74823C8 for ; Sun, 9 Oct 2016 08:57:47 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593CA60F90000000000002E17.dip0.t-ipconnect.de [IPv6:2003:c5:93ca:60f9::2e17]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id B2F151100A9 for ; Sun, 9 Oct 2016 08:57:46 +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=1475996266; bh=n8RhbtxTEYzhBk65W5CwjXeY6YzdMOvSv03Re1ZjQjo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZcaaJ3mTzIYFoMgV7gC2gzYpgVzKiPigEYMz57AhJ0ppJq8ttL+UBoDjkzns8xV08 VNZEP/PKmiFL7lI75FQuygHdeUcRqQ/G7TdtFZvUJK2iHT9//RJQ1Lu7Lw0jYVvBLw G7/6daDrgd/7engfHFFS/JU7ecoMlCFFZ2XxVYk0= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 9 Oct 2016 08:57:30 +0200 Message-Id: <20161009065738.8279-3-sven@narfation.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <1647833.jYley1tZnH@sven-edge> References: <1647833.jYley1tZnH@sven-edge> Subject: [B.A.T.M.A.N.] [PATCH next v2 03/11] 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: - remove second replacement line which basically does nothing (thanks Linus) --- compat-patches/replacements.sh | 5 +++++ net/batman-adv/netlink.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/compat-patches/replacements.sh b/compat-patches/replacements.sh index c7875c0..4439a0d 100755 --- a/compat-patches/replacements.sh +++ b/compat-patches/replacements.sh @@ -1,3 +1,8 @@ #! /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/' \ + 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 },