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
This commit is contained in:
parent
d39f9b4517
commit
87be243fa6
@ -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>
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user