From 4469d05e3803d3145f47686491c5b76b97ab178a Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Mon, 11 Sep 2017 20:14:25 +0200 Subject: Backport nfnl_msg_type() --- kernel/include/linux/netfilter/ipset/ip_set_compat.h.in | 8 ++++++++ kernel/net/netfilter/ipset/ip_set_core.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'kernel') 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 @@ -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; -- cgit v1.2.3