[1/4] batman-adv: compat: workaround for issues with make-kpkg for 4.5 kernels

Message ID 20170122204043.29668-1-linus.luessing@c0d3.blue (mailing list archive)
State Accepted, archived
Commit 102146d65c50f14d461616a5da6f25fd77a61595
Delegated to: Sven Eckelmann
Headers

Commit Message

Linus Lüssing Jan. 22, 2017, 8:40 p.m. UTC
  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 <linus.luessing@c0d3.blue>
---
 compat.h | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Sven Eckelmann Jan. 23, 2017, 8:58 a.m. UTC | #1
On Sonntag, 22. Januar 2017 21:40:40 CET Linus Lüssing wrote:
> Currently, batman-adv fails to build for 4.5 kernel headers provided by
> Debian's make-kpkg. "make" complains with:

Complete patch series applied in 78f7272..cc04c82.

Kind regards,
	Sven
  

Patch

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 <uapi/linux/pkt_cls.h>
+#endif
+
+#endif /* < KERNEL_VERSION(4, 6, 0) */
+
 #endif /* _NET_BATMAN_ADV_COMPAT_H_ */