Module Name: src
Committed By: christos
Date: Mon Mar 8 17:54:43 UTC 2021
Modified Files:
src/sys/netinet: tcp_timer.c
Log Message:
Add some randomness to the iss offset
To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/netinet/tcp_timer.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netinet/tcp_timer.c
diff -u src/sys/netinet/tcp_timer.c:1.95 src/sys/netinet/tcp_timer.c:1.96
--- src/sys/netinet/tcp_timer.c:1.95 Thu May 3 03:13:48 2018
+++ src/sys/netinet/tcp_timer.c Mon Mar 8 12:54:43 2021
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: tcp_timer.c,
#include <sys/kernel.h>
#include <sys/callout.h>
#include <sys/workqueue.h>
+#include <sys/cprng.h>
#include <net/if.h>
@@ -257,7 +258,7 @@ tcp_slowtimo_work(struct work *wk, void
{
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);