void-packages/srcpkgs/NetworkManager/patches/musl.patch

57 lines
1.3 KiB
Diff

For musl libc instead of including <linux/if_ether.h> or <net/ethernet.h>
just define the required constant ETH_ALEN locally.
--- libnm-core/nm-utils.h 2016-04-01 23:27:51.000000000 +0200
+++ libnm-core/nm-utils.h 2016-11-01 02:37:51.933498880 +0100
@@ -29,8 +29,14 @@
#include <netinet/in.h>
-/* For ETH_ALEN and INFINIBAND_ALEN */
+#if defined(__GLIBC__)
+/* For ETH_ALEN */
#include <linux/if_ether.h>
+#else
+#define ETH_ALEN 6 /* Octets in one ethernet addr */
+#endif
+
+/* For INFINIBAND_ALEN */
#include <linux/if_infiniband.h>
#include "nm-core-enum-types.h"
--- src/platform/wifi/wifi-utils.h
+++ src/platform/wifi/wifi-utils.h.new
@@ -22,10 +22,14 @@
#ifndef __WIFI_UTILS_H__
#define __WIFI_UTILS_H__
+#if defined(__GLIBC__)
#include <net/ethernet.h>
+#else
+#define ETH_ALEN 6 /* Octets in one ethernet addr */
+#endif
#include <glib.h>
#include "nm-dbus-interface.h"
typedef struct WifiData WifiData;
--- src/settings/nm-settings-connection.h
+++ src/settings/nm-settings-connection.h.new
@@ -22,10 +22,14 @@
#ifndef __NETWORKMANAGER_SETTINGS_CONNECTION_H__
#define __NETWORKMANAGER_SETTINGS_CONNECTION_H__
+#if defined(__GLIBC__)
#include <net/ethernet.h>
+#else
+#define ETH_ALEN 6 /* Octets in one ethernet addr */
+#endif
#include <nm-connection.h>
#include "nm-types.h"
G_BEGIN_DECLS