* [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: compat: workaround for issues with make-kpkg for 4.5 kernels
@ 2017-01-22 20:40 Linus Lüssing
2017-01-22 20:40 ` [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: compat: fix warning in hard-interface.c for < 4.0 Linus Lüssing
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Linus Lüssing @ 2017-01-22 20:40 UTC (permalink / raw)
To: 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 <linus.luessing@c0d3.blue>
---
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 <uapi/linux/pkt_cls.h>
+#endif
+
+#endif /* < KERNEL_VERSION(4, 6, 0) */
+
#endif /* _NET_BATMAN_ADV_COMPAT_H_ */
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: compat: fix warning in hard-interface.c for < 4.0
2017-01-22 20:40 [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: compat: workaround for issues with make-kpkg for 4.5 kernels Linus Lüssing
@ 2017-01-22 20:40 ` Linus Lüssing
2017-01-22 20:40 ` [B.A.T.M.A.N.] [PATCH 3/4] batman-adv: compat: fix compile error for cfg80211_get_station on v3.15 Linus Lüssing
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Linus Lüssing @ 2017-01-22 20:40 UTC (permalink / raw)
To: b.a.t.m.a.n
This fixes the following warning:
hard-interface.c:104:39: warning: incorrect type in return expression (different base types)
hard-interface.c:104:39: expected struct net *
hard-interface.c:104:39: got bool
Which allows compiling with -Werror again on kernels < 4.0.
Fixes: bea804dbde21 ("batman-adv: Handle parent interfaces in a different netns")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---
compat.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/compat.h b/compat.h
index 8e23911..8628cf5 100644
--- a/compat.h
+++ b/compat.h
@@ -153,8 +153,8 @@ static int __batadv_interface_kill_vid(struct net_device *dev, __be16 proto,\
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
-/* WARNING for batadv_getlink_net */
-#define get_link_net get_xstats_size || 1 || netdev->rtnl_link_ops->get_xstats_size
+/* wild hack for batadv_getlink_net only */
+#define get_link_net get_xstats_size || 1 ? fallback_net : (struct net*)netdev->rtnl_link_ops->get_xstats_size
#endif /* < KERNEL_VERSION(4, 0, 0) */
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [B.A.T.M.A.N.] [PATCH 3/4] batman-adv: compat: fix compile error for cfg80211_get_station on v3.15
2017-01-22 20:40 [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: compat: workaround for issues with make-kpkg for 4.5 kernels Linus Lüssing
2017-01-22 20:40 ` [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: compat: fix warning in hard-interface.c for < 4.0 Linus Lüssing
@ 2017-01-22 20:40 ` Linus Lüssing
2017-01-22 20:40 ` [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: compat: add missing includes for compat skbuff.c Linus Lüssing
2017-01-23 8:58 ` [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: compat: workaround for issues with make-kpkg for 4.5 kernels Sven Eckelmann
3 siblings, 0 replies; 5+ messages in thread
From: Linus Lüssing @ 2017-01-22 20:40 UTC (permalink / raw)
To: b.a.t.m.a.n
station_info::expected_throughput is present since 3.16, not 3.15,
resulting in compile errors for 3.15. Fixing this by using the correct
kernel version in compat.h.
Fixes: 5c3245172c01 ("batman-adv: ELP - compute the metric based on the estimated throughput")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---
compat.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/compat.h b/compat.h
index 8628cf5..5397629 100644
--- a/compat.h
+++ b/compat.h
@@ -130,7 +130,7 @@ static int __batadv_interface_kill_vid(struct net_device *dev, __be16 proto,\
#endif /* < KERNEL_VERSION(3, 10, 0) */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
/* the expected behaviour of this function is to return 0 on success, therefore
* it is possible to define it as 1 so that batman-adv thinks like something
@@ -149,7 +149,7 @@ static int __batadv_interface_kill_vid(struct net_device *dev, __be16 proto,\
#endif
-#endif /* < KERNEL_VERSION(3, 15, 0) */
+#endif /* < KERNEL_VERSION(3, 16, 0) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: compat: add missing includes for compat skbuff.c
2017-01-22 20:40 [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: compat: workaround for issues with make-kpkg for 4.5 kernels Linus Lüssing
2017-01-22 20:40 ` [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: compat: fix warning in hard-interface.c for < 4.0 Linus Lüssing
2017-01-22 20:40 ` [B.A.T.M.A.N.] [PATCH 3/4] batman-adv: compat: fix compile error for cfg80211_get_station on v3.15 Linus Lüssing
@ 2017-01-22 20:40 ` Linus Lüssing
2017-01-23 8:58 ` [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: compat: workaround for issues with make-kpkg for 4.5 kernels Sven Eckelmann
3 siblings, 0 replies; 5+ messages in thread
From: Linus Lüssing @ 2017-01-22 20:40 UTC (permalink / raw)
To: b.a.t.m.a.n
Compile issues were reported with some 3.2 kernel. Adding the missing
includes to the compat skbuff.c file should fix those.
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---
compat-sources/net/core/skbuff.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/compat-sources/net/core/skbuff.c b/compat-sources/net/core/skbuff.c
index 44d59dc..40c9e8b 100644
--- a/compat-sources/net/core/skbuff.c
+++ b/compat-sources/net/core/skbuff.c
@@ -32,8 +32,12 @@
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/in6.h>
#include <linux/ipv6.h>
#include <linux/skbuff.h>
+#include <linux/types.h>
+#include <net/checksum.h>
+#include <net/ip6_checksum.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: compat: workaround for issues with make-kpkg for 4.5 kernels
2017-01-22 20:40 [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: compat: workaround for issues with make-kpkg for 4.5 kernels Linus Lüssing
` (2 preceding siblings ...)
2017-01-22 20:40 ` [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: compat: add missing includes for compat skbuff.c Linus Lüssing
@ 2017-01-23 8:58 ` Sven Eckelmann
3 siblings, 0 replies; 5+ messages in thread
From: Sven Eckelmann @ 2017-01-23 8:58 UTC (permalink / raw)
To: b.a.t.m.a.n
[-- Attachment #1: Type: text/plain, Size: 262 bytes --]
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
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-01-23 8:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-22 20:40 [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: compat: workaround for issues with make-kpkg for 4.5 kernels Linus Lüssing
2017-01-22 20:40 ` [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: compat: fix warning in hard-interface.c for < 4.0 Linus Lüssing
2017-01-22 20:40 ` [B.A.T.M.A.N.] [PATCH 3/4] batman-adv: compat: fix compile error for cfg80211_get_station on v3.15 Linus Lüssing
2017-01-22 20:40 ` [B.A.T.M.A.N.] [PATCH 4/4] batman-adv: compat: add missing includes for compat skbuff.c Linus Lüssing
2017-01-23 8:58 ` [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: compat: workaround for issues with make-kpkg for 4.5 kernels Sven Eckelmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox