batman-adv: compat: fix compilation for kernels >= 4.11 on Debian

Message ID 20170424200331.21660-1-linus.luessing@c0d3.blue (mailing list archive)
State Rejected, archived
Delegated to: Simon Wunderlich
Headers

Commit Message

Linus Lüssing April 24, 2017, 8:03 p.m. UTC
  This patch is a workaround for the following issue:

[...]/batman-adv/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o
./include/linux/if.h:27:11: error: unable to open 'sys/socket.h'
In file included from ./include/linux/compat.h:16:0,
                 from ./include/linux/ethtool.h:16,
                 from [...]/batman-adv/build/../compat-include/linux/ethtool.h:25,
                 from ./include/linux/netdevice.h:42,
                 from [...]/batman-adv/build/../compat-include/linux/netdevice.h:25,
                 from ./include/linux/icmpv6.h:12,
                 from ./include/linux/ipv6.h:82,
                 from [...]/batman-adv/build/net/batman-adv/../../../compat-sources/net/core/skbuff.c:36:
./include/linux/if.h:27:54: fatal error: sys/socket.h: No such file or directory
 #include <sys/socket.h>   /* for struct sockaddr.  */

It seems to occur since:

  "uapi: fix linux/if.h userspace compilation errors"
  (2618be7dcc, Linux 4.11-rc1)

Simply including an empty sys/socket.h makes the kernel module compile
again. (The #ifndef __KERNEL__, which kernel-package / make-kpkg
stripped, should have removed this include for kernel modules anyway.)

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>

---

Fixes:
- https://www.open-mesh.org/issues/333
---
 compat-include/sys/socket.h | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 compat-include/sys/socket.h
  

Comments

Sven Eckelmann April 25, 2017, 6:28 a.m. UTC | #1
On Montag, 24. April 2017 22:03:31 CEST Linus Lüssing wrote:
[...]
> It seems to occur since:
> 
>   "uapi: fix linux/if.h userspace compilation errors"
>   (2618be7dcc, Linux 4.11-rc1)
> 
> Simply including an empty sys/socket.h makes the kernel module compile
> again. (The #ifndef __KERNEL__, which kernel-package / make-kpkg
> stripped, should have removed this include for kernel modules anyway.)

Hm, sounds again like something which should be fixed somewhere else
(not by batman-adv), right?

Kind regards,
	Sven
  

Patch

diff --git a/compat-include/sys/socket.h b/compat-include/sys/socket.h
new file mode 100644
index 0000000..8722e57
--- /dev/null
+++ b/compat-include/sys/socket.h
@@ -0,0 +1,3 @@ 
+/*
+ * Workaround for Debian's kernel-package
+ */