dhcp-improved-xid.patch: correct byte order so the printed xid is the same as in tcpdump/wireshark
This commit is contained in:
parent
c7dbb5f487
commit
96d5a640ad
@ -71,7 +71,7 @@ diff -up dhcp-4.3.0a1/client/dhclient.c.improved-xid dhcp-4.3.0a1/client/dhclien
|
|||||||
}
|
}
|
||||||
|
|
||||||
- log_info ("DHCPACK from %s", piaddr (packet -> client_addr));
|
- 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);
|
lease = packet_to_lease (packet, client);
|
||||||
if (!lease) {
|
if (!lease) {
|
||||||
@ -80,7 +80,7 @@ diff -up dhcp-4.3.0a1/client/dhclient.c.improved-xid dhcp-4.3.0a1/client/dhclien
|
|||||||
}
|
}
|
||||||
|
|
||||||
- log_info ("DHCPNAK from %s", piaddr (packet -> client_addr));
|
- 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 (!client -> active) {
|
||||||
#if defined (DEBUG)
|
#if defined (DEBUG)
|
||||||
@ -93,7 +93,7 @@ diff -up dhcp-4.3.0a1/client/dhclient.c.improved-xid dhcp-4.3.0a1/client/dhclien
|
|||||||
client -> name ? client -> name : client -> interface -> name,
|
client -> name ? client -> name : client -> interface -> name,
|
||||||
inet_ntoa (sockaddr_broadcast.sin_addr),
|
inet_ntoa (sockaddr_broadcast.sin_addr),
|
||||||
- ntohs (sockaddr_broadcast.sin_port), (long)(client -> interval));
|
- 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. */
|
/* Send out a packet. */
|
||||||
result = send_packet(client->interface, NULL, &client->packet,
|
result = send_packet(client->interface, NULL, &client->packet,
|
||||||
@ -106,7 +106,7 @@ diff -up dhcp-4.3.0a1/client/dhclient.c.improved-xid dhcp-4.3.0a1/client/dhclien
|
|||||||
client -> name ? client -> name : client -> interface -> name,
|
client -> name ? client -> name : client -> interface -> name,
|
||||||
inet_ntoa (destination.sin_addr),
|
inet_ntoa (destination.sin_addr),
|
||||||
- ntohs (destination.sin_port));
|
- ntohs (destination.sin_port));
|
||||||
+ ntohs (destination.sin_port), client -> xid);
|
+ ntohs (destination.sin_port), ntohl(client -> xid));
|
||||||
|
|
||||||
if (destination.sin_addr.s_addr != INADDR_BROADCAST &&
|
if (destination.sin_addr.s_addr != INADDR_BROADCAST &&
|
||||||
fallback_interface) {
|
fallback_interface) {
|
||||||
@ -119,7 +119,7 @@ diff -up dhcp-4.3.0a1/client/dhclient.c.improved-xid dhcp-4.3.0a1/client/dhclien
|
|||||||
client->name ? client->name : client->interface->name,
|
client->name ? client->name : client->interface->name,
|
||||||
inet_ntoa(sockaddr_broadcast.sin_addr),
|
inet_ntoa(sockaddr_broadcast.sin_addr),
|
||||||
- ntohs(sockaddr_broadcast.sin_port));
|
- ntohs(sockaddr_broadcast.sin_port));
|
||||||
+ ntohs(sockaddr_broadcast.sin_port), client -> xid);
|
+ ntohs(sockaddr_broadcast.sin_port), ntohl(client -> xid));
|
||||||
|
|
||||||
/* Send out a packet. */
|
/* Send out a packet. */
|
||||||
result = send_packet(client->interface, NULL, &client->packet,
|
result = send_packet(client->interface, NULL, &client->packet,
|
||||||
@ -132,7 +132,7 @@ diff -up dhcp-4.3.0a1/client/dhclient.c.improved-xid dhcp-4.3.0a1/client/dhclien
|
|||||||
client -> name ? client -> name : client -> interface -> name,
|
client -> name ? client -> name : client -> interface -> name,
|
||||||
inet_ntoa (destination.sin_addr),
|
inet_ntoa (destination.sin_addr),
|
||||||
- ntohs (destination.sin_port));
|
- ntohs (destination.sin_port));
|
||||||
+ ntohs (destination.sin_port), client -> xid);
|
+ ntohs (destination.sin_port), ntohl(client -> xid));
|
||||||
|
|
||||||
if (fallback_interface) {
|
if (fallback_interface) {
|
||||||
result = send_packet(fallback_interface, NULL, &client->packet,
|
result = send_packet(fallback_interface, NULL, &client->packet,
|
||||||
|
Loading…
Reference in New Issue
Block a user