From patchwork Tue Oct 2 17:51:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 10623921 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7EAC01515 for ; Tue, 2 Oct 2018 17:51:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D77627D4A for ; Tue, 2 Oct 2018 17:51:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6023027E5A; Tue, 2 Oct 2018 17:51:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5C4A27D0E for ; Tue, 2 Oct 2018 17:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726529AbeJCAf5 (ORCPT ); Tue, 2 Oct 2018 20:35:57 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:47542 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726233AbeJCAf5 (ORCPT ); Tue, 2 Oct 2018 20:35:57 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.91) (envelope-from ) id 1g7OpP-0003Fx-DP; Tue, 02 Oct 2018 19:51:23 +0200 From: Johannes Berg To: backports@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 2/6] backports: fix genlmsg_nlhdr() backport Date: Tue, 2 Oct 2018 19:51:03 +0200 Message-Id: <20181002175107.16336-2-johannes@sipsolutions.net> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181002175107.16336-1-johannes@sipsolutions.net> References: <20181002175107.16336-1-johannes@sipsolutions.net> Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Berg 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 --- 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) \