blob: 9a58c0e3410881529097b70f7f767963967237b0 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From 714b4731a238653e9c7d885c0dee10677b0a4df3 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Thu, 22 Mar 2018 18:24:07 +0100
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08004Subject: [PATCH] musl: network support
Brad Bishop316dfdd2018-06-25 12:45:53 -04005MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Upstream-Status: Pending
10
11Stolen from [1] and prettyfied slightly
12
13[1] https://github.com/voidlinux/void-packages/tree/master/srcpkgs/NetworkManager/patches
14
15Signed-off-by: Andreas MΓΌller <schnitzeltony@gmail.com>
16---
17 libnm-core/nm-utils.h | 4 ++++
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080018 src/platform/wifi/nm-wifi-utils.h | 4 ++++
Brad Bishop316dfdd2018-06-25 12:45:53 -040019 src/systemd/src/basic/socket-util.h | 5 +++++
20 3 files changed, 13 insertions(+)
21
22diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
23index df9284b..2bcf4b8 100644
24--- a/libnm-core/nm-utils.h
25+++ b/libnm-core/nm-utils.h
26@@ -30,7 +30,11 @@
27 #include <netinet/in.h>
28
29 /* For ETH_ALEN and INFINIBAND_ALEN */
30+#if defined(__GLIBC__)
31 #include <linux/if_ether.h>
32+#else
33+#define ETH_ALEN 6 /* Octets in one ethernet addr */
34+#endif
35 #include <linux/if_infiniband.h>
36
37 #include "nm-core-enum-types.h"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080038diff --git a/src/platform/wifi/nm-wifi-utils.h b/src/platform/wifi/nm-wifi-utils.h
Brad Bishop316dfdd2018-06-25 12:45:53 -040039index 705717b..da3edc4 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080040--- a/src/platform/wifi/nm-wifi-utils.h
41+++ b/src/platform/wifi/nm-wifi-utils.h
Brad Bishop316dfdd2018-06-25 12:45:53 -040042@@ -22,7 +22,11 @@
43 #ifndef __WIFI_UTILS_H__
44 #define __WIFI_UTILS_H__
45
46+#if defined(__GLIBC__)
47 #include <net/ethernet.h>
48+#else /* musl libc */
49+#define ETH_ALEN 6 /* Octets in one ethernet addr */
50+#endif
51
52 #include "nm-dbus-interface.h"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080053 #include "nm-setting-wireless.h"
Brad Bishop316dfdd2018-06-25 12:45:53 -040054diff --git a/src/systemd/src/basic/socket-util.h b/src/systemd/src/basic/socket-util.h
55index d7e2d85..d109c84 100644
56--- a/src/systemd/src/basic/socket-util.h
57+++ b/src/systemd/src/basic/socket-util.h
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080058@@ -11,6 +11,11 @@
Brad Bishop316dfdd2018-06-25 12:45:53 -040059 #include <linux/netlink.h>
60 #include <linux/if_infiniband.h>
61 #include <linux/if_packet.h>
62+#if !defined(__GLIBC__)
63+/* SIOCGSTAMPNS from linux/asm-generic.h
64+ * for src/systemd/src/libsystemd-network/sd-lldp.c */
65+#include <linux/sockios.h>
66+#endif
67
68 #include "macro.h"
69 #include "missing.h"
70--
712.14.3
72