41 lines
1.3 KiB
Diff
41 lines
1.3 KiB
Diff
--- shared/n-dhcp4/src/n-dhcp4-c-probe.c.orig 2020-01-06 15:35:10.128600647 +0100
|
|
+++ shared/n-dhcp4/src/n-dhcp4-c-probe.c 2020-01-06 15:39:41.446240531 +0100
|
|
@@ -362,7 +362,12 @@ static void n_dhcp4_client_probe_config_
|
|
seed16v[1] = (u64 >> 16) ^ (u64 >> 0);
|
|
seed16v[2] = (u64 >> 32) ^ (u64 >> 16);
|
|
|
|
+#ifdef __GLIBC__
|
|
r = seed48_r(seed16v, &config->entropy);
|
|
+#else
|
|
+ r = 0;
|
|
+ seed48(seed16v);
|
|
+#endif
|
|
c_assert(!r);
|
|
}
|
|
|
|
@@ -379,7 +384,12 @@ uint32_t n_dhcp4_client_probe_config_get
|
|
long int result;
|
|
int r;
|
|
|
|
+#ifdef __GLIBC__
|
|
r = mrand48_r(&config->entropy, &result);
|
|
+#else
|
|
+ r = 0;
|
|
+ result = mrand48();
|
|
+#endif
|
|
c_assert(!r);
|
|
|
|
return result;
|
|
--- shared/n-dhcp4/src/n-dhcp4-private.h.orig 2020-01-06 15:41:31.941501136 +0100
|
|
+++ shared/n-dhcp4/src/n-dhcp4-private.h 2020-01-06 15:41:55.341556325 +0100
|
|
@@ -267,7 +267,9 @@ struct NDhcp4ClientProbeConfig {
|
|
bool inform_only;
|
|
bool init_reboot;
|
|
struct in_addr requested_ip;
|
|
+#ifdef __GLIBC__
|
|
struct drand48_data entropy; /* 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];
|