diff options
author | David Malone <dwmalone@FreeBSD.org> | 2004-08-14 15:32:40 +0000 |
---|---|---|
committer | David Malone <dwmalone@FreeBSD.org> | 2004-08-14 15:32:40 +0000 |
commit | 1f44b0a1b539198ce55bf97e73d51ded20a55ab4 (patch) | |
tree | 56a806b0847f95ede378bb97ce9bfcb595420ea2 /sys/netinet/ip_id.c | |
parent | e7581f0fc2b97703022b42069967a8cfca46e8a2 (diff) | |
download | src-1f44b0a1b539198ce55bf97e73d51ded20a55ab4.tar.gz src-1f44b0a1b539198ce55bf97e73d51ded20a55ab4.zip |
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
Notes
Notes:
svn path=/head/; revision=133720
Diffstat (limited to 'sys/netinet/ip_id.c')
-rw-r--r-- | sys/netinet/ip_id.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/sys/netinet/ip_id.c b/sys/netinet/ip_id.c index 700f731d4912..c8455f808225 100644 --- a/sys/netinet/ip_id.c +++ b/sys/netinet/ip_id.c @@ -57,14 +57,12 @@ * This avoids reuse issues caused by reseeding. */ -#include "opt_random_ip_id.h" #include "opt_pf.h" #include <sys/param.h> #include <sys/time.h> #include <sys/kernel.h> #include <sys/random.h> -#if defined(RANDOM_IP_ID) || defined(DEV_PF) #define RU_OUT 180 /* Time after wich will be reseeded */ #define RU_MAX 30000 /* Uniq cycle, avoid blackjack prediction */ #define RU_GEN 2 /* Starting generator */ @@ -209,4 +207,3 @@ ip_randomid(void) return (ru_seed ^ pmod(ru_g,ru_seed2 ^ ru_x,RU_N)) | ru_msb; } -#endif /* RANDOM_IP_ID || DEV_PF */ |