From 5df13d37b27b8510415fb500f01a289443950ebb Mon Sep 17 00:00:00 2001 From: dwmalone Date: Sat, 14 Aug 2004 15:32:40 +0000 Subject: Get rid of the RANDOM_IP_ID option and make it a sysctl. NetBSD have already done this, so I have styled the patch on their work: 1) introduce a ip_newid() static inline function that checks the sysctl and then decides if it should return a sequential or random IP ID. 2) named the sysctl net.inet.ip.random_id 3) IPv6 flow IDs and fragment IDs are now always random. Flow IDs and frag IDs are significantly less common in the IPv6 world (ie. rarely generated per-packet), so there should be smaller performance concerns. The sysctl defaults to 0 (sequential IP IDs). Reviewed by: andre, silby, mlaier, ume Based on: NetBSD MFC after: 2 months --- sys/netinet/tcp_usrreq.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'sys/netinet/tcp_usrreq.c') diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 1e96129..df6fa74 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -33,7 +33,6 @@ #include "opt_ipsec.h" #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_random_ip_id.h" #include "opt_tcpdebug.h" #include @@ -946,12 +945,8 @@ tcp6_connect(tp, nam, td) /* update flowinfo - draft-itojun-ipv6-flowlabel-api-00 */ inp->in6p_flowinfo &= ~IPV6_FLOWLABEL_MASK; if (inp->in6p_flags & IN6P_AUTOFLOWLABEL) - inp->in6p_flowinfo |= -#ifdef RANDOM_IP_ID + inp->in6p_flowinfo |= (htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK); -#else - (htonl(ip6_flow_seq++) & IPV6_FLOWLABEL_MASK); -#endif in_pcbrehash(inp); /* Compute window scaling to request. */ -- cgit v1.1