From 64dddc18727af4db4a6047ff86291d981f6e9042 Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Fri, 1 Jun 2001 10:02:28 +0000 Subject: 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 --- sys/netinet/ip_var.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/netinet/ip_var.h') diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index bc8b7978459d..6354d84da527 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -138,7 +138,9 @@ struct route; struct sockopt; extern struct ipstat ipstat; +#ifndef RANDOM_IP_ID extern u_short ip_id; /* ip packet ctr, for ids */ +#endif extern int ip_defttl; /* default IP ttl */ extern int ipforwarding; /* ip forwarding */ extern struct route ipforward_rt; /* ip forwarding cached route */ @@ -164,6 +166,10 @@ void ip_slowtimo __P((void)); struct mbuf * ip_srcroute __P((void)); void ip_stripoptions __P((struct mbuf *, struct mbuf *)); +#ifdef RANDOM_IP_ID +u_int16_t + ip_randomid __P((void)); +#endif int rip_ctloutput __P((struct socket *, struct sockopt *)); void rip_ctlinput __P((int, struct sockaddr *, void *)); void rip_init __P((void)); -- cgit v1.3