summaryrefslogtreecommitdiffstats
path: root/sbin/dhclient/packet.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-09-11 05:48:39 +0000
committerglebius <glebius@FreeBSD.org>2014-09-11 05:48:39 +0000
commit0c2257eddc2dd0f0dbf9ac64367937490e1c09e3 (patch)
tree832f26940bdbfb8d1ea5fb9b3e346958d7bcedc2 /sbin/dhclient/packet.c
parent6af056918d57e324b2393579ed7d161ddd1f1cc0 (diff)
downloadFreeBSD-src-0c2257eddc2dd0f0dbf9ac64367937490e1c09e3.zip
FreeBSD-src-0c2257eddc2dd0f0dbf9ac64367937490e1c09e3.tar.gz
Since r270929 raw sockets expect network byte order.
Submitted by: avg
Diffstat (limited to 'sbin/dhclient/packet.c')
-rw-r--r--sbin/dhclient/packet.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/sbin/dhclient/packet.c b/sbin/dhclient/packet.c
index f79ca2f..859f48b 100644
--- a/sbin/dhclient/packet.c
+++ b/sbin/dhclient/packet.c
@@ -127,17 +127,6 @@ assemble_udp_ip_header(unsigned char *buf, int *bufix, u_int32_t from,
ip.ip_dst.s_addr = to;
ip.ip_sum = wrapsum(checksum((unsigned char *)&ip, sizeof(ip), 0));
-
- /*
- * While the BPF -- used for broadcasts -- expects a "true" IP header
- * with all the bytes in network byte order, the raw socket interface
- * which is used for unicasts expects the ip_len field to be in host
- * byte order. In both cases, the checksum has to be correct, so this
- * is as good a place as any to turn the bytes around again.
- */
- if (to != INADDR_BROADCAST)
- ip.ip_len = ntohs(ip.ip_len);
-
memcpy(&buf[*bufix], &ip, sizeof(ip));
*bufix += sizeof(ip);
OpenPOWER on IntegriCloud