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(-)
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 },