Module Name: src Committed By: msaitoh Date: Wed Oct 9 05:29:18 UTC 2019
Modified Files: src/sys/netinet: tcp_congctl.c Log Message: All of snd_wnd, snd_cwnd and snd_ssthresh in stuct tcpcb are u_long, so use u_long and ulmin() instead of u_int and uimin(). Found by lgtm bot. XXX TCP's sequence number is uint32_t, so it might be good to change some entries in struct tcpcb to uint32_t instead of u_long. FreeBSD did it. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/netinet/tcp_congctl.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_congctl.c diff -u src/sys/netinet/tcp_congctl.c:1.26 src/sys/netinet/tcp_congctl.c:1.27 --- src/sys/netinet/tcp_congctl.c:1.26 Mon Sep 3 16:29:36 2018 +++ src/sys/netinet/tcp_congctl.c Wed Oct 9 05:29:18 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_congctl.c,v 1.26 2018/09/03 16:29:36 riastradh Exp $ */ +/* $NetBSD: tcp_congctl.c,v 1.27 2019/10/09 05:29:18 msaitoh Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2001, 2005, 2006 The NetBSD Foundation, Inc. @@ -135,7 +135,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tcp_congctl.c,v 1.26 2018/09/03 16:29:36 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_congctl.c,v 1.27 2019/10/09 05:29:18 msaitoh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -427,12 +427,12 @@ tcp_congctl_fillnames(void) static void tcp_common_congestion_exp(struct tcpcb *tp, int betaa, int betab) { - u_int win; + u_long win; /* * Reduce the congestion window and the slow start threshold. */ - win = uimin(tp->snd_wnd, tp->snd_cwnd) * betaa / betab / tp->t_segsz; + win = ulmin(tp->snd_wnd, tp->snd_cwnd) * betaa / betab / tp->t_segsz; if (win < 2) win = 2; @@ -519,7 +519,7 @@ tcp_reno_fast_retransmit(struct tcpcb *t static void tcp_reno_slow_retransmit(struct tcpcb *tp) { - u_int win; + u_long win; /* * Close the congestion window down to one segment @@ -546,7 +546,7 @@ tcp_reno_slow_retransmit(struct tcpcb *t * to go below this.) */ - win = uimin(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_segsz; + win = ulmin(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_segsz; if (win < 2) win = 2; /* Loss Window MUST be one segment. */