-diff -up dhcp-4.2.4b1/client/dhclient.c.improved-xid dhcp-4.2.4b1/client/dhclient.c
---- dhcp-4.2.4b1/client/dhclient.c.improved-xid 2012-04-16 17:42:37.444217424 +0200
-+++ dhcp-4.2.4b1/client/dhclient.c 2012-04-16 17:45:32.105770755 +0200
-@@ -888,6 +888,26 @@ main(int argc, char **argv) {
+diff -up dhcp-4.3.4/client/dhclient.c.improved-xid dhcp-4.3.4/client/dhclient.c
+--- dhcp-4.3.4/client/dhclient.c.improved-xid 2016-04-29 12:54:55.997102182 +0200
++++ dhcp-4.3.4/client/dhclient.c 2016-04-29 12:57:25.123139587 +0200
+@@ -1045,6 +1045,26 @@ main(int argc, char **argv) {
}
}
/* At this point, all the interfaces that the script thinks
are relevant should be running, so now we once again call
discover_interfaces(), and this time ask it to actually set
-@@ -902,14 +922,36 @@ main(int argc, char **argv) {
+@@ -1059,14 +1079,36 @@ main(int argc, char **argv) {
Not much entropy, but we're booting, so we're not likely to
find anything better. */
seed = 0;
+ }
+ /* we only use seed and no current time as a broadcast reply */
+ /* will certainly be used by the hwaddrless interface */
-+ srandom(seed);
++ srandom(seed + ((unsigned)(cur_tv.tv_usec * 1000000)) + (unsigned)getpid());
+ }
+ else
-+ srandom(seed + cur_time + (unsigned)getpid());
++ srandom(seed + ((unsigned)(cur_tv.tv_usec * 1000000)) + (unsigned)getpid());
/* Setup specific Infiniband options */
for (ip = interfaces; ip; ip = ip->next) {
-@@ -1447,7 +1489,7 @@ void dhcpack (packet)
+@@ -1633,7 +1675,7 @@ void dhcpack (packet)
return;
}
- log_info ("DHCPACK from %s", piaddr (packet -> client_addr));
-+ log_info ("DHCPACK from %s (xid=0x%x)", piaddr (packet -> client_addr), client -> xid);
++ log_info ("DHCPACK from %s (xid=0x%x)", piaddr (packet -> client_addr), ntohl(client -> xid));
lease = packet_to_lease (packet, client);
if (!lease) {
-@@ -2164,7 +2206,7 @@ void dhcpnak (packet)
+@@ -2541,7 +2583,7 @@ void dhcpnak (packet)
return;
}
- log_info ("DHCPNAK from %s", piaddr (packet -> client_addr));
-+ log_info ("DHCPNAK from %s (xid=0x%x)", piaddr (packet -> client_addr), client -> xid);
++ log_info ("DHCPNAK from %s (xid=0x%x)", piaddr (packet -> client_addr), ntohl(client -> xid));
if (!client -> active) {
#if defined (DEBUG)
-@@ -2290,10 +2332,10 @@ void send_discover (cpp)
- client -> packet.secs = htons (65535);
- client -> secs = client -> packet.secs;
-
+@@ -2674,10 +2716,10 @@ void send_discover (cpp)
+ (long)(client -> interval));
+ } else
+ #endif
- log_info ("DHCPDISCOVER on %s to %s port %d interval %ld",
+ log_info ("DHCPDISCOVER on %s to %s port %d interval %ld (xid=0x%x)",
client -> name ? client -> name : client -> interface -> name,
inet_ntoa (sockaddr_broadcast.sin_addr),
- ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval));
-+ ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval), client -> xid);
++ ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval), ntohl(client -> xid));
/* Send out a packet. */
- result = send_packet(client->interface, NULL, &client->packet,
-@@ -2577,10 +2619,10 @@ void send_request (cpp)
- client -> packet.secs = htons (65535);
- }
-
+ #if defined(DHCPv6) && defined(DHCP4o6)
+@@ -2962,10 +3004,10 @@ void send_request (cpp)
+ log_info ("DHCPREQUEST");
+ } else
+ #endif
- log_info ("DHCPREQUEST on %s to %s port %d",
+ log_info ("DHCPREQUEST on %s to %s port %d (xid=0x%x)",
client -> name ? client -> name : client -> interface -> name,
inet_ntoa (destination.sin_addr),
- ntohs (destination.sin_port));
-+ ntohs (destination.sin_port), client -> xid);
-
- if (destination.sin_addr.s_addr != INADDR_BROADCAST &&
- fallback_interface) {
-@@ -2620,10 +2662,10 @@ void send_decline (cpp)
-
- int result;
++ ntohs (destination.sin_port), ntohl(client -> xid));
+ #if defined(DHCPv6) && defined(DHCP4o6)
+ if (dhcpv4_over_dhcpv6) {
+@@ -3022,10 +3064,10 @@ void send_decline (cpp)
+ log_info ("DHCPDECLINE");
+ } else
+ #endif
- log_info ("DHCPDECLINE on %s to %s port %d",
+ log_info ("DHCPDECLINE on %s to %s port %d (xid=0x%x)",
client->name ? client->name : client->interface->name,
inet_ntoa(sockaddr_broadcast.sin_addr),
- ntohs(sockaddr_broadcast.sin_port));
-+ ntohs(sockaddr_broadcast.sin_port), client -> xid);
++ ntohs(sockaddr_broadcast.sin_port), ntohl(client -> xid));
/* Send out a packet. */
- result = send_packet(client->interface, NULL, &client->packet,
-@@ -2666,10 +2708,10 @@ void send_release (cpp)
- return;
- }
-
+ #if defined(DHCPv6) && defined(DHCP4o6)
+@@ -3084,10 +3126,10 @@ void send_release (cpp)
+ log_info ("DHCPRELEASE");
+ } else
+ #endif
- log_info ("DHCPRELEASE on %s to %s port %d",
+ log_info ("DHCPRELEASE on %s to %s port %d (xid=0x%x)",
client -> name ? client -> name : client -> interface -> name,
inet_ntoa (destination.sin_addr),
- ntohs (destination.sin_port));
-+ ntohs (destination.sin_port), client -> xid);
++ ntohs (destination.sin_port), ntohl(client -> xid));
- if (fallback_interface) {
- result = send_packet(fallback_interface, NULL, &client->packet,
+ #if defined(DHCPv6) && defined(DHCP4o6)
+ if (dhcpv4_over_dhcpv6) {