diff options
author | kris <kris@FreeBSD.org> | 2001-06-01 10:02:28 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2001-06-01 10:02:28 +0000 |
commit | e1524eb20ca44614d4942a0b92929a02e67dce44 (patch) | |
tree | 9bd8aa0fc8cabc5d0cc01510f30e42d4a12277e2 /sys/netinet/ip_input.c | |
parent | 83f8b7087fd25f91158a6a096fad46b33b513773 (diff) | |
download | FreeBSD-src-e1524eb20ca44614d4942a0b92929a02e67dce44.zip FreeBSD-src-e1524eb20ca44614d4942a0b92929a02e67dce44.tar.gz |
Add ``options RANDOM_IP_ID'' which randomizes the ID field of IP packets.
This closes a minor information leak which allows a remote observer to
determine the rate at which the machine is generating packets, since the
default behaviour is to increment a counter for each packet sent.
Reviewed by: -net
Obtained from: OpenBSD
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 0963a0a..f0f4a20 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -44,6 +44,7 @@ #include "opt_ipstealth.h" #include "opt_ipsec.h" #include "opt_pfil_hooks.h" +#include "opt_random_ip_id.h" #include <sys/param.h> #include <sys/systm.h> @@ -249,7 +250,9 @@ ip_init() maxnipq = nmbclusters/4; +#ifndef RANDOM_IP_ID ip_id = time_second & 0xffff; +#endif ipintrq.ifq_maxlen = ipqmaxlen; mtx_init(&ipintrq.ifq_mtx, "ip_inq", MTX_DEF); |