NetworkManager: add musl patches
This commit is contained in:
parent
4ce686254c
commit
33d1bc2800
|
@ -0,0 +1,15 @@
|
||||||
|
diff --git src/systemd/src/libsystemd-network/sd-dhcp6-client.c src/systemd/src/libsystemd-network/sd-dhcp6-client.c
|
||||||
|
index f67a45bd2..ec11fa605 100644
|
||||||
|
--- src/systemd/src/libsystemd-network/sd-dhcp6-client.c
|
||||||
|
+++ src/systemd/src/libsystemd-network/sd-dhcp6-client.c
|
||||||
|
@@ -8,8 +8,10 @@
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
+#ifdef __GLIBC__
|
||||||
|
#include <linux/if_arp.h>
|
||||||
|
#include <linux/if_infiniband.h>
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#include "sd-dhcp6-client.h"
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
diff --git shared/systemd/src/basic/sort-util.h shared/systemd/src/basic/sort-util.h
|
||||||
|
index e029f8646..168735087 100644
|
||||||
|
--- shared/systemd/src/basic/sort-util.h
|
||||||
|
+++ shared/systemd/src/basic/sort-util.h
|
||||||
|
@@ -60,7 +60,11 @@ static inline void qsort_r_safe(void *base, size_t nmemb, size_t size, __compar_
|
||||||
|
return;
|
||||||
|
|
||||||
|
assert(base);
|
||||||
|
+#ifdef __GLIBC__
|
||||||
|
qsort_r(base, nmemb, size, compar, userdata);
|
||||||
|
+#else
|
||||||
|
+ g_qsort_with_data(base, nmemb, size, compar, userdata);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#define typesafe_qsort_r(p, n, func, userdata) \
|
|
@ -1,48 +0,0 @@
|
||||||
diff --git shared/n-dhcp4/src/n-dhcp4-c-probe.c shared/n-dhcp4/src/n-dhcp4-c-probe.c
|
|
||||||
index 308cff830..9463528b1 100644
|
|
||||||
--- shared/n-dhcp4/src/n-dhcp4-c-probe.c
|
|
||||||
+++ shared/n-dhcp4/src/n-dhcp4-c-probe.c
|
|
||||||
@@ -362,8 +362,12 @@ static void n_dhcp4_client_probe_config_initialize_random_seed(NDhcp4ClientProbe
|
|
||||||
seed16v[1] = (u64 >> 16) ^ (u64 >> 0);
|
|
||||||
seed16v[2] = (u64 >> 32) ^ (u64 >> 16);
|
|
||||||
|
|
||||||
+#ifdef __GLIBC__
|
|
||||||
r = seed48_r(seed16v, &config->entropy);
|
|
||||||
c_assert(!r);
|
|
||||||
+#else
|
|
||||||
+ memcpy(config->entropy, seed16v, sizeof seed16v);
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
@@ -377,10 +381,14 @@ static void n_dhcp4_client_probe_config_initialize_random_seed(NDhcp4ClientProbe
|
|
||||||
*/
|
|
||||||
uint32_t n_dhcp4_client_probe_config_get_random(NDhcp4ClientProbeConfig *config) {
|
|
||||||
long int result;
|
|
||||||
+#ifdef __GLIBC__
|
|
||||||
int r;
|
|
||||||
|
|
||||||
r = mrand48_r(&config->entropy, &result);
|
|
||||||
c_assert(!r);
|
|
||||||
+#else
|
|
||||||
+ result = jrand48(config->entropy);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
diff --git shared/n-dhcp4/src/n-dhcp4-private.h shared/n-dhcp4/src/n-dhcp4-private.h
|
|
||||||
index c38ddbfc8..fb4880771 100644
|
|
||||||
--- shared/n-dhcp4/src/n-dhcp4-private.h
|
|
||||||
+++ shared/n-dhcp4/src/n-dhcp4-private.h
|
|
||||||
@@ -259,7 +259,11 @@ struct NDhcp4ClientProbeConfig {
|
|
||||||
bool inform_only;
|
|
||||||
bool init_reboot;
|
|
||||||
struct in_addr requested_ip;
|
|
||||||
+#ifdef __GLIBC__
|
|
||||||
struct drand48_data entropy; /* entropy pool */
|
|
||||||
+#else
|
|
||||||
+ unsigned short entropy[3]; /* entropy pool */
|
|
||||||
+#endif
|
|
||||||
uint64_t ms_start_delay; /* max ms to wait before starting probe */
|
|
||||||
NDhcp4ClientProbeOption *options[UINT8_MAX + 1];
|
|
||||||
int8_t request_parameters[UINT8_MAX + 1];
|
|
Loading…
Reference in New Issue