From patchwork Sun Jan 22 20:40:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 16897 X-Patchwork-Delegate: sven@narfation.org 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 740C280CF5; Sun, 22 Jan 2017 21:41:30 +0100 (CET) Authentication-Results: open-mesh.org; dmarc=none header.from=c0d3.blue Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a01:4f8:171:314c::100:a1; helo=mail.aperture-lab.de; envelope-from=linus.luessing@c0d3.blue; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=none header.from=c0d3.blue Received: from mail.aperture-lab.de (mail.aperture-lab.de [IPv6:2a01:4f8:171:314c::100:a1]) by open-mesh.org (Postfix) with ESMTPS id C4E148036E for ; Sun, 22 Jan 2017 21:41:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.aperture-lab.de (Postfix) with ESMTP id B793CE05DD; Sun, 22 Jan 2017 21:41:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aperture-lab.de Received: from mail.aperture-lab.de ([127.0.0.1]) by localhost (mail.aperture-lab.de [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id qFY05TLQxIoX; Sun, 22 Jan 2017 21:41:28 +0100 (CET) Received: from localhost (unknown [IPv6:2001:67c:2d50:0:c85:8cff:fe0f:63fe]) (Authenticated sender: linus.luessing@c0d3.blue) by mail.aperture-lab.de (Postfix) with ESMTPSA; Sun, 22 Jan 2017 21:41:28 +0100 (CET) From: =?utf-8?q?Linus_L=C3=BCssing?= To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 22 Jan 2017 21:40:40 +0100 Message-Id: <20170122204043.29668-1-linus.luessing@c0d3.blue> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: compat: workaround for issues with make-kpkg for 4.5 kernels X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 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" Currently, batman-adv fails to build for 4.5 kernel headers provided by Debian's make-kpkg. "make" complains with: "include/net/sch_generic.h:413:2: error: implicit declaration of function ‘G_TC_AT’ [-Werror=implicit-function-declaration]" And: "include/net/sch_generic.h:413:33: error: ‘AT_INGRESS’ undeclared (first use in this function)" The issue seems to be that make-kpkg creates two pkt_cls.h with the same include guard but differing contents, "uapi/linux/pkt_cls.h" and "linux/pkt_cls.h". The latter has its "#ifdef __KERNEL__" section stripped and therefore misses the needed defines. Depending on the include order, the batman-adv might fail. This commit provides a workaround by ensuring that the full-blown uapi variant is included first. Eventually, the issue should be fixed in make-kpkg and this commit reverted (no response from the make-kpkg Debian maintainer yet). For future reference and updates: * https://www.open-mesh.org/issues/322 Signed-off-by: Linus Lüssing --- compat.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compat.h b/compat.h index d61a30e..8e23911 100644 --- a/compat.h +++ b/compat.h @@ -164,4 +164,13 @@ static int __batadv_interface_kill_vid(struct net_device *dev, __be16 proto,\ #endif /* < KERNEL_VERSION(4, 3, 0) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) + +/* workaround for current issues with Debian's make-kpkg */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) +#include +#endif + +#endif /* < KERNEL_VERSION(4, 6, 0) */ + #endif /* _NET_BATMAN_ADV_COMPAT_H_ */