Index: sys/kern/uipc_socket.c =================================================================== RCS file: /mount/openbsd/cvs/src/sys/kern/uipc_socket.c,v diff -u -p -u -p -r1.344 uipc_socket.c --- sys/kern/uipc_socket.c 31 Oct 2024 12:51:55 -0000 1.344 +++ sys/kern/uipc_socket.c 5 Nov 2024 05:02:24 -0000 @@ -2368,6 +2368,7 @@ sofilt_lock(struct socket *so, struct so case PF_INET: case PF_INET6: NET_LOCK_SHARED(); + rw_enter_write(&so->so_lock); break; default: rw_enter_write(&so->so_lock); @@ -2385,6 +2386,7 @@ sofilt_unlock(struct socket *so, struct switch (so->so_proto->pr_domain->dom_family) { case PF_INET: case PF_INET6: + rw_exit_write(&so->so_lock); NET_UNLOCK_SHARED(); break; default: Index: sys/kern/uipc_socket2.c =================================================================== RCS file: /mount/openbsd/cvs/src/sys/kern/uipc_socket2.c,v diff -u -p -u -p -r1.158 uipc_socket2.c --- sys/kern/uipc_socket2.c 12 Jul 2024 19:50:35 -0000 1.158 +++ sys/kern/uipc_socket2.c 5 Nov 2024 05:02:24 -0000 @@ -365,11 +365,8 @@ solock_shared(struct socket *so) switch (so->so_proto->pr_domain->dom_family) { case PF_INET: case PF_INET6: - if (ISSET(so->so_proto->pr_flags, PR_MPSOCKET)) { - NET_LOCK_SHARED(); - rw_enter_write(&so->so_lock); - } else - NET_LOCK(); + NET_LOCK_SHARED(); + rw_enter_write(&so->so_lock); break; default: rw_enter_write(&so->so_lock); @@ -425,11 +422,8 @@ sounlock_shared(struct socket *so) switch (so->so_proto->pr_domain->dom_family) { case PF_INET: case PF_INET6: - if (ISSET(so->so_proto->pr_flags, PR_MPSOCKET)) { - rw_exit_write(&so->so_lock); - NET_UNLOCK_SHARED(); - } else - NET_UNLOCK(); + rw_exit_write(&so->so_lock); + NET_UNLOCK_SHARED(); break; default: rw_exit_write(&so->so_lock); @@ -481,15 +475,9 @@ sosleep_nsec(struct socket *so, void *id switch (so->so_proto->pr_domain->dom_family) { case PF_INET: case PF_INET6: - if (ISSET(so->so_proto->pr_flags, PR_MPSOCKET) && - rw_status(&netlock) == RW_READ) { - rw_exit_write(&so->so_lock); - } + rw_exit_write(&so->so_lock); ret = rwsleep_nsec(ident, &netlock, prio, wmesg, nsecs); - if (ISSET(so->so_proto->pr_flags, PR_MPSOCKET) && - rw_status(&netlock) == RW_READ) { - rw_enter_write(&so->so_lock); - } + rw_enter_write(&so->so_lock); break; default: ret = rwsleep_nsec(ident, &so->so_lock, prio, wmesg, nsecs); Index: sys/netinet/tcp_fsm.h =================================================================== RCS file: /mount/openbsd/cvs/src/sys/netinet/tcp_fsm.h,v diff -u -p -u -p -r1.9 tcp_fsm.h --- sys/netinet/tcp_fsm.h 5 Feb 2018 14:53:26 -0000 1.9 +++ sys/netinet/tcp_fsm.h 5 Nov 2024 05:02:24 -0000 @@ -68,7 +68,7 @@ * determined by state, with the proviso that TH_FIN is sent only * if all data queued for output is included in the segment. */ -u_char tcp_outflags[TCP_NSTATES] = { +const u_char tcp_outflags[TCP_NSTATES] = { TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK, TH_ACK, TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK, @@ -76,7 +76,7 @@ u_char tcp_outflags[TCP_NSTATES] = { #endif /* TCPOUTFLAGS */ #ifdef TCPSTATES -const char *tcpstates[] = { +const char *const tcpstates[] = { "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD", "ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING", "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT", Index: sys/netinet/tcp_output.c =================================================================== RCS file: /mount/openbsd/cvs/src/sys/netinet/tcp_output.c,v diff -u -p -u -p -r1.145 tcp_output.c --- sys/netinet/tcp_output.c 14 May 2024 09:39:02 -0000 1.145 +++ sys/netinet/tcp_output.c 5 Nov 2024 05:02:24 -0000 @@ -103,8 +103,6 @@ extern struct mbuf *m_copypack(); #endif -extern int tcprexmtthresh; - #ifdef TCP_SACK_DEBUG void tcp_print_holes(struct tcpcb *tp); @@ -350,7 +348,7 @@ again: txmaxseg = ulmin(so->so_snd.sb_hiwat / 2, tp->t_maxseg); if (len > txmaxseg) { - if (tcp_do_tso && + if (atomic_load_int(&tcp_do_tso) && tp->t_inpcb->inp_options == NULL && tp->t_inpcb->inp_outputopts6 == NULL && #ifdef TCP_SIGNATURE Index: sys/netinet/tcp_timer.c =================================================================== RCS file: /mount/openbsd/cvs/src/sys/netinet/tcp_timer.c,v diff -u -p -u -p -r1.76 tcp_timer.c --- sys/netinet/tcp_timer.c 28 Jan 2024 20:34:25 -0000 1.76 +++ sys/netinet/tcp_timer.c 5 Nov 2024 05:02:24 -0000 @@ -167,10 +167,10 @@ tcp_canceltimers(struct tcpcb *tp) TCP_TIMER_DISARM(tp, i); } -int tcp_backoff[TCP_MAXRXTSHIFT + 1] = +const int tcp_backoff[TCP_MAXRXTSHIFT + 1] = { 1, 2, 4, 8, 16, 32, 64, 64, 64, 64, 64, 64, 64 }; -int tcp_totbackoff = 511; /* sum of tcp_backoff[] */ +const int tcp_totbackoff = 511; /* sum of tcp_backoff[] */ /* * TCP timer processing. Index: sys/netinet/tcp_timer.h =================================================================== RCS file: /mount/openbsd/cvs/src/sys/netinet/tcp_timer.h,v diff -u -p -u -p -r1.21 tcp_timer.h --- sys/netinet/tcp_timer.h 29 Jan 2024 22:47:13 -0000 1.21 +++ sys/netinet/tcp_timer.h 5 Nov 2024 05:02:24 -0000 @@ -154,13 +154,12 @@ typedef void (*tcp_timer_func_t)(void *) extern const tcp_timer_func_t tcp_timer_funcs[TCPT_NTIMERS]; extern int tcp_delack_msecs; /* delayed ACK timeout in millisecs */ -extern int tcptv_keep_init; extern int tcp_always_keepalive; /* assume SO_KEEPALIVE is always set */ extern int tcp_keepidle; /* time before keepalive probes begin */ extern int tcp_keepintvl; /* time between keepalive probes */ extern int tcp_maxidle; /* time to drop after starting probes */ extern int tcp_ttl; /* time to live for TCP segs */ -extern int tcp_backoff[]; +extern const int tcp_backoff[]; void tcp_timer_init(void); #endif /* _KERNEL */ Index: sys/netinet/tcp_var.h =================================================================== RCS file: /mount/openbsd/cvs/src/sys/netinet/tcp_var.h,v diff -u -p -u -p -r1.178 tcp_var.h --- sys/netinet/tcp_var.h 13 May 2024 01:15:53 -0000 1.178 +++ sys/netinet/tcp_var.h 5 Nov 2024 05:02:24 -0000 @@ -678,6 +678,7 @@ extern const struct pr_usrreqs tcp6_usrr extern struct pool tcpcb_pool; extern struct inpcbtable tcbtable, tcb6table; /* queue of active tcpcb's */ extern int tcp_do_rfc1323; /* enabled/disabled? */ +extern int tcprexmtthresh; /* [I] */ extern int tcptv_keep_init; /* [N] time to keep alive initial SYN packet */ extern int tcp_mssdflt; /* default maximum segment size */ extern int tcp_rst_ppslim; /* maximum outgoing RST packet per second */ Index: sys/sys/mbuf.h =================================================================== RCS file: /mount/openbsd/cvs/src/sys/sys/mbuf.h,v diff -u -p -u -p -r1.264 mbuf.h --- sys/sys/mbuf.h 29 Aug 2024 10:44:40 -0000 1.264 +++ sys/sys/mbuf.h 5 Nov 2024 05:02:24 -0000 @@ -413,7 +413,7 @@ struct mbuf_queue { struct pool; extern long nmbclust; /* limit on the # of clusters */ -extern int max_linkhdr; /* largest link-level header */ +extern int max_linkhdr; /* [I] largest link-level header */ extern int max_protohdr; /* largest protocol header */ extern int max_hdr; /* largest link+protocol header */ extern struct cpumem *mbstat; /* mbuf statistics counter */ Index: sys/sys/socketvar.h =================================================================== RCS file: /mount/openbsd/cvs/src/sys/sys/socketvar.h,v diff -u -p -u -p -r1.134 socketvar.h --- sys/sys/socketvar.h 9 Sep 2024 07:38:45 -0000 1.134 +++ sys/sys/socketvar.h 5 Nov 2024 05:02:24 -0000 @@ -376,7 +376,7 @@ sbassertlocked(struct sockbuf *sb) } \ } while (/*CONSTCOND*/0) -extern u_long sb_max; +extern u_long sb_max; /* [I] */ extern struct pool socket_pool;