Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Add some randomness to the iss offset



details:   https://anonhg.NetBSD.org/src/rev/aab99a74fab9
branches:  trunk
changeset: 953417:aab99a74fab9
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Mar 08 17:54:43 2021 +0000

description:
Add some randomness to the iss offset

diffstat:

 sys/netinet/tcp_timer.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r a47daf7136ed -r aab99a74fab9 sys/netinet/tcp_timer.c
--- a/sys/netinet/tcp_timer.c   Mon Mar 08 17:54:23 2021 +0000
+++ b/sys/netinet/tcp_timer.c   Mon Mar 08 17:54:43 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcp_timer.c,v 1.95 2018/05/03 07:13:48 maxv Exp $      */
+/*     $NetBSD: tcp_timer.c,v 1.96 2021/03/08 17:54:43 christos Exp $  */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -93,7 +93,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_timer.c,v 1.95 2018/05/03 07:13:48 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_timer.c,v 1.96 2021/03/08 17:54:43 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -111,6 +111,7 @@
 #include <sys/kernel.h>
 #include <sys/callout.h>
 #include <sys/workqueue.h>
+#include <sys/cprng.h>
 
 #include <net/if.h>
 
@@ -257,7 +258,7 @@
 {
 
        mutex_enter(softnet_lock);
-       tcp_iss_seq += TCP_ISSINCR;                     /* increment iss */
+       tcp_iss_seq += TCP_ISSINCR + (TCP_ISS_RANDOM_MASK & cprng_fast32());
        tcp_now++;                                      /* for timestamps */
        mutex_exit(softnet_lock);
 



Home | Main Index | Thread Index | Old Index