backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: backports@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 2/6] backports: fix genlmsg_nlhdr() backport
Date: Tue,  2 Oct 2018 19:51:03 +0200	[thread overview]
Message-ID: <20181002175107.16336-2-johannes@sipsolutions.net> (raw)
In-Reply-To: <20181002175107.16336-1-johannes@sipsolutions.net>

From: Johannes Berg <johannes.berg@intel.com>

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>
---
 backport/backport-include/net/genetlink.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h
index dfbacbf40723..d80d979ac423 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)		\
-- 
2.14.4

--
To unsubscribe from this list: send the line "unsubscribe backports" in

  reply	other threads:[~2018-10-02 17:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-02 17:51 [PATCH 1/6] backports: rename magic functions for netlink parsing Johannes Berg
2018-10-02 17:51 ` Johannes Berg [this message]
2018-10-02 17:51 ` [PATCH 3/6] backports: add copy-list.hwsim Johannes Berg
2018-10-02 17:51 ` [PATCH 4/6] backports: backport most of improved netlink policy validation Johannes Berg
2018-10-02 17:51 ` [PATCH 5/6] backports: add __skb_peek() Johannes Berg
2018-10-02 17:51 ` [PATCH 6/6] backports: genetlink: update completely Johannes Berg
2018-10-02 18:38   ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181002175107.16336-2-johannes@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=backports@vger.kernel.org \
    --cc=johannes.berg@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).