diff options
author | Jonathan Lemon <jlemon@FreeBSD.org> | 2001-12-21 04:41:08 +0000 |
---|---|---|
committer | Jonathan Lemon <jlemon@FreeBSD.org> | 2001-12-21 04:41:08 +0000 |
commit | 45a0329051ee4e5a018893def634b73d3df40fd4 (patch) | |
tree | dcae0b83a338727559fd79c7cbb292628a983d0d /sys/netinet | |
parent | 205b2b610713c7ea47fa4b60dbc96fcc19970267 (diff) | |
download | src-45a0329051ee4e5a018893def634b73d3df40fd4.tar.gz src-45a0329051ee4e5a018893def634b73d3df40fd4.zip |
If syncookies are disabled (net.inet.tcp.syncookies) then use the faster
arc4random() routine to generate ISNs instead of creating them with MD5().
Suggested by: silby
Notes
Notes:
svn path=/head/; revision=88330
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_debug.c | 1 | ||||
-rw-r--r-- | sys/netinet/tcp_syncache.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet/tcp_debug.c b/sys/netinet/tcp_debug.c index 89e9d7cbc94a..531d894453f7 100644 --- a/sys/netinet/tcp_debug.c +++ b/sys/netinet/tcp_debug.c @@ -55,6 +55,7 @@ #include <sys/protosw.h> #include <sys/socket.h> +#include <net/route.h> #include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/ip.h> diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index d6ce983adfc8..bf6432bf69f7 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -900,7 +900,10 @@ syncache_add(inc, to, th, sop, m) sc->sc_route.ro_rt = NULL; } sc->sc_irs = th->th_seq; - sc->sc_iss = syncookie_generate(sc); + if (tcp_syncookies) + sc->sc_iss = syncookie_generate(sc); + else + sc->sc_iss = arc4random(); /* Initial receive window: clip sbspace to [0 .. TCP_MAXWIN] */ win = sbspace(&so->so_rcv); |