summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2018-10-02 13:39:36 +0200
committerJohannes Berg <johannes.berg@intel.com>2018-10-02 21:25:49 +0200
commitb23307ce22375750378efc5f6f355a4bbebfa02c (patch)
treef6eb0c8dd4427713b09aa8724d0d0ea82aa574d8
parent742732dae9a60818b90592f3d93ca1870d00d67c (diff)
backports: fix genlmsg_nlhdr() backport
Since 4.15 this no longer takes a family argument, so add that to the backports instead of trying to work around the family argument having changed type. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--backport/backport-include/net/genetlink.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h
index dfbacbf4..d80d979a 100644
--- a/backport/backport-include/net/genetlink.h
+++ b/backport/backport-include/net/genetlink.h
@@ -60,6 +60,14 @@ static inline void *genl_info_userhdr(struct genl_info *info)
#endif
#if LINUX_VERSION_IS_LESS(4,15,0)
+#define genlmsg_nlhdr LINUX_BACKPORT(genlmsg_nlhdr)
+static inline struct nlmsghdr *genlmsg_nlhdr(void *user_hdr)
+{
+ return (struct nlmsghdr *)((char *)user_hdr -
+ GENL_HDRLEN -
+ NLMSG_HDRLEN);
+}
+
#ifndef genl_dump_check_consistent
static inline
void backport_genl_dump_check_consistent(struct netlink_callback *cb,
@@ -153,8 +161,6 @@ extern void genl_notify(struct sk_buff *skb, struct net *net, u32 pid,
(_fam)->mcgrps[_group].id, _info->nlhdr, _flags)
#define genlmsg_put(_skb, _pid, _seq, _fam, _flags, _cmd) \
genlmsg_put(_skb, _pid, _seq, &(_fam)->family, _flags, _cmd)
-#define genlmsg_nlhdr(_hdr, _fam) \
- genlmsg_nlhdr(_hdr, &(_fam)->family)
#ifndef genlmsg_put_reply /* might already be there from _info override above */
#define genlmsg_put_reply(_skb, _info, _fam, _flags, _cmd) \