From patchwork Tue Oct 30 21:01:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17600 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id E93A9830F2; Tue, 30 Oct 2018 22:01:43 +0100 (CET) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="ypuWyXZD"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 828358026B for ; Tue, 30 Oct 2018 22:01:41 +0100 (CET) Received: from sven-desktop.home.narfation.org (p200300C593D31FFD0000000000004065.dip0.t-ipconnect.de [IPv6:2003:c5:93d3:1ffd::4065]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 11094110116; Tue, 30 Oct 2018 22:01:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1540933301; bh=JUBjotYUlIiAJkAAN8cKxCIli8Xehdl5hzTal0Oaw8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ypuWyXZDddhQETTXnjALGtjMjTuvYDThj3ZPOunUppNuadlTTVg/EQxIjiRHOwr6W EOOoW3MX8OkAh4gFXA4C6G2NRAev4B1OkOMIv0O64kTdaoBtu+fwDyCb9YWIPDAi9R cvlQPX1rE33wcUQlZsHFCG95cPaQmia+zcK9Qrgk= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 30 Oct 2018 22:01:22 +0100 Message-Id: <20181030210130.18152-2-sven@narfation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181030210130.18152-1-sven@narfation.org> References: <20181030210130.18152-1-sven@narfation.org> MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH 1/9] batman-adv: Add compat for genl_dump_check_consistent X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" The commit 0a833c29d896 ("genetlink: fix genlmsg_nlhdr()") removed the family parameter for genl_dump_check_consistent. It is actually not needed because batman-adv doesn't use userspace headers and a dummy family with hdrsize 0 can be used for these kernel versions. Signed-off-by: Sven Eckelmann --- compat-include/net/genetlink.h | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 compat-include/net/genetlink.h diff --git a/compat-include/net/genetlink.h b/compat-include/net/genetlink.h new file mode 100644 index 00000000..026500c3 --- /dev/null +++ b/compat-include/net/genetlink.h @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (C) 2007-2018 B.A.T.M.A.N. contributors: + * + * Marek Lindner, Simon Wunderlich + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + * + * This file contains macros for maintaining compatibility with older versions + * of the Linux kernel. + */ + +#ifndef _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_ +#define _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_ + +#include +#include_next + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) + +static inline +void batadv_genl_dump_check_consistent(struct netlink_callback *cb, + void *user_hdr) +{ + struct genl_family genl_family = { + .hdrsize = 0, + }; + + genl_dump_check_consistent(cb, user_hdr, &genl_family); +} + +#define genl_dump_check_consistent batadv_genl_dump_check_consistent + +#endif /* < KERNEL_VERSION(4, 15, 0) */ + +#endif /* _NET_BATMAN_ADV_COMPAT_NET_GENETLINK_H_ */