blob: 5dd17b63b45126b16f8fc3d324195a05d258513f [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
4Subject: [PATCH 3/4] musl: network support
5MIME-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 ++++
18 src/platform/wifi/wifi-utils.h | 4 ++++
19 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"
38diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h
39index 705717b..da3edc4 100644
40--- a/src/platform/wifi/wifi-utils.h
41+++ b/src/platform/wifi/wifi-utils.h
42@@ -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"
53
54diff --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
58@@ -29,6 +29,11 @@
59 #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