summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAndre Oppermann <andre@FreeBSD.org>2004-01-09 12:18:17 +0000
committerAndre Oppermann <andre@FreeBSD.org>2004-01-09 12:18:17 +0000
commit222a2708bb353f01ee21a0767e436c09816b9022 (patch)
tree1ace1554d7a5acfc6b1f4ae7efbe8cc8eb519730 /sys
parent598a20cc0e6bb34019047496372a01421d7a1917 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_output.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 0a115249aa5e..733df47c6a58 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -229,10 +229,10 @@ ip_output(struct mbuf *m0, struct mbuf *opt, struct route *ro,
/*
* Fill in IP header. If we are not allowing fragmentation,
- * then the ip_id field is meaningless, so send it as zero
- * to reduce information leakage. Otherwise, if we are not
- * randomizing ip_id, then don't bother to convert it to network
- * byte order -- it's just a nonce. Note that a 16-bit counter
+ * then the ip_id field is meaningless, but we don't set it
+ * to zero. Doing so causes various problems when devices along
+ * the path (routers, load balancers, firewalls, etc.) illegally
+ * disable DF on our packet. Note that a 16-bit counter
* will wrap around in less than 10 seconds at 100 Mbit/s on a
* medium with MTU 1500. See Steven M. Bellovin, "A Technique
* for Counting NATted Hosts", Proc. IMW'02, available at
@@ -241,17 +241,11 @@ ip_output(struct mbuf *m0, struct mbuf *opt, struct route *ro,
if ((flags & (IP_FORWARDING|IP_RAWOUTPUT)) == 0) {
ip->ip_v = IPVERSION;
ip->ip_hl = hlen >> 2;
- if ((ip->ip_off & IP_DF) == 0) {
- ip->ip_off = 0;
#ifdef RANDOM_IP_ID
- ip->ip_id = ip_randomid();
+ ip->ip_id = ip_randomid();
#else
- ip->ip_id = ip_id++;
+ ip->ip_id = htons(ip_id++);
#endif
- } else {
- ip->ip_off = IP_DF;
- ip->ip_id = 0;
- }
ipstat.ips_localout++;
} else {
hlen = ip->ip_hl << 2;