[next,v2,03/11] batman-adv: make netlink attributes const
Commit Message
From: stephen hemminger <stephen@networkplumber.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
[sven@narfation.org: Add compat-patch script]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
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(-)
Comments
On Sonntag, 9. Oktober 2016 08:57:30 CEST Sven Eckelmann wrote:
> From: stephen hemminger <stephen@networkplumber.org>
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> [sven@narfation.org: Add compat-patch script]
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> 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(-)
Applied in 801d51e947da78bc542b30ee8e6971f941f8f66b [1]. It was slightly
modified to use __genl_const from https://patchwork.open-mesh.org/patch/16730/
Kind regards,
Sven
[1] https://git.open-mesh.org/batman-adv.git/commit/801d51e947da78bc542b30ee8e6971f941f8f66b
@@ -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
@@ -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 },