-/* $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 $ */
/*
* 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.
-/* $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 $ */
/*
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.
*/
-/* $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 $ */
/*
* 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.
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,
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)
if ((unsigned)cmd >= PRC_NCMDS)
return;
else if (cmd == PRC_QUENCH) {
- /*
+ /*
* Don't honor ICMP Source Quench messages meant for
* TCP connections.
*/
return;
errno = inetctlerrmap[cmd];
if (cmd == PRC_QUENCH)
- /*
+ /*
* Don't honor ICMP Source Quench messages meant for
* TCP connections.
*/
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.
return;
}
if (mtu >= tcp_hdrsz(tp) + tp->t_pmtud_mss_acked) {
- /*
+ /*
* Calculate new MTU, and create corresponding
* route (traditional PMTUD).
*/
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);
-/* $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 $ */
/*
* 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;
-/* $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 $ */
/*
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)
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.
-/* $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 $ */
/*
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 {
* 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.
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 */
* 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 */
{ "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 }, \
}