summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2017-09-11 20:14:25 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2017-09-11 20:14:25 +0200
commit4469d05e3803d3145f47686491c5b76b97ab178a (patch)
treeacb9e5ef704305ed5c8d45d09c51794141d2e476 /kernel
parent54802b2c28265769c2dc1b126419ac673316eb64 (diff)
Backport nfnl_msg_type()
Diffstat (limited to 'kernel')
-rw-r--r--kernel/include/linux/netfilter/ipset/ip_set_compat.h.in8
-rw-r--r--kernel/net/netfilter/ipset/ip_set_core.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
index a6f9093..002e3db 100644
--- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
+++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
@@ -38,6 +38,7 @@
#@HAVE_STATE_IN_XT_ACTION_PARAM@ HAVE_STATE_IN_XT_ACTION_PARAM
#@HAVE_XT_FAMILY@ HAVE_XT_FAMILY
#@HAVE_XT_NET@ HAVE_XT_NET
+#@HAVE_NFNL_MSG_TYPE@ HAVE_NFNL_MSG_TYPE
#ifdef HAVE_EXPORT_SYMBOL_GPL_IN_MODULE_H
#include <linux/module.h>
@@ -296,6 +297,13 @@ static inline __be16 tc_skb_protocol(const struct sk_buff *skb)
#define IPSET_DEV_NET(par) dev_net((par)->in ? (par)->in : (par)->out)
#endif
+#ifndef HAVE_NFNL_MSG_TYPE
+static inline u16 nfnl_msg_type(u8 subsys, u8 msg_type)
+{
+ return subsys << 8 | msg_type;
+}
+#endif
+
#ifdef HAVE_STATE_IN_XT_ACTION_PARAM
#define XAP_STATE(par) (par->state)
#else
diff --git a/kernel/net/netfilter/ipset/ip_set_core.c b/kernel/net/netfilter/ipset/ip_set_core.c
index 3bb832d..de43aa1 100644
--- a/kernel/net/netfilter/ipset/ip_set_core.c
+++ b/kernel/net/netfilter/ipset/ip_set_core.c
@@ -774,7 +774,7 @@ start_msg(struct sk_buff *skb, u32 portid, u32 seq, unsigned int flags,
struct nlmsghdr *nlh;
struct nfgenmsg *nfmsg;
- nlh = nlmsg_put(skb, portid, seq, cmd | (NFNL_SUBSYS_IPSET << 8),
+ nlh = nlmsg_put(skb, portid, seq, nfnl_msg_type(NFNL_SUBSYS_IPSET, cmd),
sizeof(*nfmsg), flags);
if (!nlh)
return NULL;