From: bluhm Date: Thu, 11 Jan 2024 13:49:49 +0000 (+0000) Subject: Fix white spaces in TCP. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6285ef2327cc1f84a7e4194aa246d8e81dacf985;p=openbsd Fix white spaces in TCP. --- diff --git a/sys/netinet/tcp_debug.c b/sys/netinet/tcp_debug.c index 0fa8614000c..ae784dcec98 100644 --- a/sys/netinet/tcp_debug.c +++ b/sys/netinet/tcp_debug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_debug.c,v 1.30 2022/02/22 01:15:02 guenther Exp $ */ +/* $OpenBSD: tcp_debug.c,v 1.31 2024/01/11 13:49:49 bluhm Exp $ */ /* $NetBSD: tcp_debug.c,v 1.10 1996/02/13 23:43:36 christos Exp $ */ /* @@ -42,10 +42,10 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgements: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * This product includes software developed at the Information - * Technology Division, US Naval Research Laboratory. + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * This product includes software developed at the Information + * Technology Division, US Naval Research Laboratory. * 4. Neither the name of the NRL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index ef28525209d..87501282178 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.397 2023/12/01 15:30:47 bluhm Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.398 2024/01/11 13:49:49 bluhm Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -3932,7 +3932,7 @@ syn_cache_add(struct sockaddr *src, struct sockaddr *dst, struct tcphdr *th, if (syn_cache_respond(sc, m, now) == 0) { mtx_enter(&syn_cache_mtx); /* - * XXXSMP Currently exclusive netlock prevents another insert + * XXXSMP Currently exclusive netlock prevents another insert * after our syn_cache_lookup() and before syn_cache_insert(). * Double insert should be handled and not rely on netlock. */ diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 8da9975386f..6d65aa84948 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.194 2023/11/29 18:30:48 bluhm Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.195 2024/01/11 13:49:49 bluhm Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -42,10 +42,10 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgements: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * This product includes software developed at the Information - * Technology Division, US Naval Research Laboratory. + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * This product includes software developed at the Information + * Technology Division, US Naval Research Laboratory. * 4. Neither the name of the NRL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -396,7 +396,7 @@ tcp_respond(struct tcpcb *tp, caddr_t template, struct tcphdr *th0, case AF_INET6: ip6->ip6_flow = htonl(0x60000000); ip6->ip6_nxt = IPPROTO_TCP; - ip6->ip6_hlim = in6_selecthlim(tp ? tp->t_inpcb : NULL); /*XXX*/ + ip6->ip6_hlim = in6_selecthlim(tp ? tp->t_inpcb : NULL); /*XXX*/ ip6->ip6_plen = tlen - sizeof(struct ip6_hdr); ip6->ip6_plen = htons(ip6->ip6_plen); ip6_output(m, tp ? tp->t_inpcb->inp_outputopts6 : NULL, @@ -455,10 +455,10 @@ tcp_newtcpcb(struct inpcb *inp, int wait) TCPTV_MIN, TCPTV_REXMTMAX); tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT; - + tp->t_pmtud_mtu_sent = 0; tp->t_pmtud_mss_acked = 0; - + #ifdef INET6 /* we disallow IPv4 mapped address completely. */ if ((inp->inp_flags & INP_IPV6) == 0) @@ -628,7 +628,7 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *d) if ((unsigned)cmd >= PRC_NCMDS) return; else if (cmd == PRC_QUENCH) { - /* + /* * Don't honor ICMP Source Quench messages meant for * TCP connections. */ @@ -731,7 +731,7 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *v) return; errno = inetctlerrmap[cmd]; if (cmd == PRC_QUENCH) - /* + /* * Don't honor ICMP Source Quench messages meant for * TCP connections. */ @@ -755,7 +755,7 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *v) icp = (struct icmp *)((caddr_t)ip - offsetof(struct icmp, icmp_ip)); - /* + /* * If the ICMP message advertises a Next-Hop MTU * equal or larger than the maximum packet size we have * ever sent, drop the message. @@ -766,7 +766,7 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, u_int rdomain, void *v) return; } if (mtu >= tcp_hdrsz(tp) + tp->t_pmtud_mss_acked) { - /* + /* * Calculate new MTU, and create corresponding * route (traditional PMTUD). */ @@ -1074,7 +1074,7 @@ tcp_signature(struct tdb *tdb, int af, struct mbuf *m, struct tcphdr *th, if (len > 0 && m_apply(m, iphlen + th->th_off * sizeof(uint32_t), len, tcp_signature_apply, (caddr_t)&ctx)) - return (-1); + return (-1); MD5Update(&ctx, tdb->tdb_amxkey, tdb->tdb_amxkeylen); MD5Final(sig, &ctx); diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 4f241bf2e1b..a2f9724f49e 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_timer.c,v 1.73 2023/07/06 09:15:24 bluhm Exp $ */ +/* $OpenBSD: tcp_timer.c,v 1.74 2024/01/11 13:49:49 bluhm Exp $ */ /* $NetBSD: tcp_timer.c,v 1.14 1996/02/13 23:44:09 christos Exp $ */ /* @@ -367,7 +367,9 @@ tcp_timer_rexmt(void *arg) * to go below this.) */ { - u_long win = ulmin(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg; + u_long win; + + win = ulmin(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg; if (win < 2) win = 2; tp->snd_cwnd = tp->t_maxseg; diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index cfbe0f963a1..83f02631d04 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.227 2023/12/03 20:24:17 bluhm Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.228 2024/01/11 13:49:49 bluhm Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -175,7 +175,7 @@ int tcp_fill_info(struct tcpcb *, struct socket *, struct mbuf *); int tcp_ident(void *, size_t *, void *, size_t, int); static inline int tcp_sogetpcb(struct socket *, struct inpcb **, - struct tcpcb **); + struct tcpcb **); static inline int tcp_sogetpcb(struct socket *so, struct inpcb **rinp, struct tcpcb **rtp) @@ -579,7 +579,7 @@ tcp_listen(struct socket *so) if (inp->inp_lport == 0) if ((error = in_pcbbind(inp, NULL, curproc))) goto out; - + /* * If the in_pcbbind() above is called, the tp->pf * should still be whatever it was before. diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index b687d436dc5..6f4950679e4 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_var.h,v 1.173 2023/11/29 19:19:25 bluhm Exp $ */ +/* $OpenBSD: tcp_var.h,v 1.174 2024/01/11 13:49:49 bluhm Exp $ */ /* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */ /* @@ -43,7 +43,7 @@ struct sackblk { tcp_seq start; /* start seq no. of sack block */ - tcp_seq end; /* end seq no. */ + tcp_seq end; /* end seq no. */ }; struct sackhole { @@ -334,7 +334,8 @@ struct syn_cache_set { * is the same as the multiplier for rttvar. */ #define TCP_REXMTVAL(tp) \ - ((((tp)->t_srtt >> TCP_RTT_SHIFT) + (tp)->t_rttvar) >> TCP_RTT_BASE_SHIFT) + ((((tp)->t_srtt >> TCP_RTT_SHIFT) + (tp)->t_rttvar) \ + >> TCP_RTT_BASE_SHIFT) /* * TCP statistics. @@ -406,8 +407,8 @@ struct tcpstat { u_int32_t tcps_rcvbadsig; /* rcvd bad/missing TCP signatures */ u_int64_t tcps_rcvgoodsig; /* rcvd good TCP signatures */ - u_int32_t tcps_inswcsum; /* input software-checksummed packets */ - u_int32_t tcps_outswcsum; /* output software-checksummed packets */ + u_int32_t tcps_inswcsum; /* input software-checksummed pkts */ + u_int32_t tcps_outswcsum; /* output software-checksummed pkts */ /* ECN stats */ u_int32_t tcps_ecn_accepts; /* ecn connections accepted */ @@ -465,8 +466,8 @@ struct tcpstat { * Names for TCP sysctl objects. */ -#define TCPCTL_RFC1323 1 /* enable/disable RFC1323 timestamps/scaling */ -#define TCPCTL_KEEPINITTIME 2 /* TCPT_KEEP value */ +#define TCPCTL_RFC1323 1 /* enable RFC1323 timestamps/scaling */ +#define TCPCTL_KEEPINITTIME 2 /* TCPT_KEEP value */ #define TCPCTL_KEEPIDLE 3 /* allow tcp_keepidle to be changed */ #define TCPCTL_KEEPINTVL 4 /* allow tcp_keepintvl to be changed */ #define TCPCTL_SLOWHZ 5 /* return kernel idea of PR_SLOWHZ */ @@ -503,23 +504,23 @@ struct tcpstat { { "baddynamic", CTLTYPE_STRUCT }, \ { NULL, 0 }, \ { NULL, 0 }, \ - { "ident", CTLTYPE_STRUCT }, \ + { "ident", CTLTYPE_STRUCT }, \ { "sack", CTLTYPE_INT }, \ { "mssdflt", CTLTYPE_INT }, \ { "rstppslimit", CTLTYPE_INT }, \ { "ackonpush", CTLTYPE_INT }, \ - { "ecn", CTLTYPE_INT }, \ - { "syncachelimit", CTLTYPE_INT }, \ - { "synbucketlimit", CTLTYPE_INT }, \ - { "rfc3390", CTLTYPE_INT }, \ - { "reasslimit", CTLTYPE_INT }, \ - { "drop", CTLTYPE_STRUCT }, \ - { "sackholelimit", CTLTYPE_INT }, \ + { "ecn", CTLTYPE_INT }, \ + { "syncachelimit", CTLTYPE_INT }, \ + { "synbucketlimit", CTLTYPE_INT }, \ + { "rfc3390", CTLTYPE_INT }, \ + { "reasslimit", CTLTYPE_INT }, \ + { "drop", CTLTYPE_STRUCT }, \ + { "sackholelimit", CTLTYPE_INT }, \ { "stats", CTLTYPE_STRUCT }, \ { "always_keepalive", CTLTYPE_INT }, \ - { "synuselimit", CTLTYPE_INT }, \ + { "synuselimit", CTLTYPE_INT }, \ { "rootonly", CTLTYPE_STRUCT }, \ - { "synhashsize", CTLTYPE_INT }, \ + { "synhashsize", CTLTYPE_INT }, \ { "tso", CTLTYPE_INT }, \ }