Commit graph

8070 commits

Author SHA1 Message Date
Zhenlei Huang
f621d0afb0 bridge: Fix adding gif(4) interface assigned with IP addresses as bridge memeber
and fix assigning IP addresses to the gif(4) interface when it is a
member of a if_bridge(4) interface.

When setting the sysctl net.link.bridge.member_ifaddrs to 1, if_bridge(4)
can eliminate unnecessary walk of the member list to determine whether
the inbound unicast packets are for us or not.

Well when a gif(4) interface is member of a if_bridge(4) interface, it
acts as the tunnel endpoint to tunnel Ethernet frames over IP network,
aka the EtherIP protocol, so the IP addresses configured on it are
independent of the if_bridge(4) interface or other if_bridge(4) members,
hence the sysctl net.link.bridge.member_ifaddrs should not have any
influnce over gif(4) interfaces's behavior of assigning IP addresses.

PR:		227450
Reported by:	Siva Mahadevan <me@svmhdvn.name>
Reviewed by:	ivy, #bridge
MFC after:	1 week
Fixes:		0a1294f6c610 bridge: allow IP addresses on members to be disabled
Differential Revision:	https://reviews.freebsd.org/D52200

(cherry picked from commit 9764aa1ccad08a7ec53ed9b80741b9553f3fa4e6)
2025-10-06 17:05:58 +02:00
Zhenlei Huang
6000c9ebc2 ifnet: Defer detaching address family dependent data
While diagnosing PR 279653 and PR 285129, I observed that thread may
write to freed memory but the system does not crash. This hides the
real problem. A clear NULL pointer derefence is much better than writing
to freed memory.

PR:	279653
PR:	285129
Reviewed by:	glebius
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D49444

(cherry picked from commit b5c46895fdddcdb7dd1994598925d6989ea7c8f2)
2025-10-06 17:00:46 +02:00
Franco Fichtner
ab2281de18 Revert "tcp: mitigate a side channel for detection of TCP connections"
This reverts commit 89cd3740e9.
2025-09-08 12:14:15 +02:00
Michael Tuexen
3c9b52cf26 udp: use appropriate error counters
Since there are multicast and broadcast specific error counters,
use them.

Reviewed by:		rrs
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D51869

(cherry picked from commit 0312f80349eedfc2b0d2f24b4fd073795148d3d5)
2025-09-08 10:39:28 +02:00
Michael Tuexen
499bfea65d icmp: clear offset and flags when reflecting a packet
When reflecting a packet, use an offset of 0 and clear all three bits,
in particular the DF bit.

PR:			288558
Reviewed by:		markj, zlei
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D51991

(cherry picked from commit b9a2d84b1bf7f9cf556e2f0b68023d5af8362797)
2025-09-08 10:36:56 +02:00
Michael Tuexen
89cd3740e9 tcp: mitigate a side channel for detection of TCP connections
If a blind attacker wants to guess by sending ACK segments if there
exists a TCP connection , this might trigger a challenge ACK on an
existing TCP connection. To make this hit non-observable for the
attacker, also increment the global counter, which would have been
incremented if it would have been a non-hit.
This issue was reported as issue number 11 in Keyu Man et al.:
SCAD: Towards a Universal and Automated Network Side-Channel
      Vulnerability Detection

Reviewed by:		Nick Banks, Peter Lei
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D51724

(cherry picked from commit f0f6e50388963cae44bb92bb69ed7a1135dd2eec)
2025-09-08 10:35:32 +02:00
Michael Tuexen
269fcca16d tcp: remove stale comment
Sponsored by:	Netflix, Inc.

(cherry picked from commit 9a4b30dabf075ce1c7565ffbec1d34d52f7dbefd)
2025-09-08 10:34:56 +02:00
Michael Tuexen
2c3e72ee20 tcp: remove TCPTV_TWTRUNC
It is not used anymore...

Reviewed by:		rscheff, Peter Lei
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D50900

(cherry picked from commit 124120d44ba23ccc44144f9fc48d35818c660dc1)
2025-09-08 10:33:58 +02:00
Michael Tuexen
d9519ec9b6 tcp: fix local blackholing
The sysctl-variable net.inet.tcp.blackhole_local should affect
TCP segments from an IPv6 address of the local host, not of a host
on the local area network.
Thanks to cc@ for pointing me to the issue.

Reviewed by:		cc
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D50828

(cherry picked from commit de8fb1b3835758998a53d772deeebcdb71bbb823)
2025-09-08 10:32:42 +02:00
Peter Lei
f5585f4302 tcp: remove references to Lock(b)
Reviewed by: 	tuexen
Sponsored by:	Netflix, Inc.

(cherry picked from commit 41c1db8a4daae24dff545ee2d20ba6ffe8abd625)
2025-09-08 10:31:54 +02:00
Peter Lei
4e8131857d tcp rack: remove duplicate header include
Reviewed by:	tuexen
Sponsored by:	Netflix, Inc.

(cherry picked from commit 2385565fac21554085a818975d3b7a97f7a4591e)
2025-09-08 10:31:10 +02:00
Michael Tuexen
81de3b027d tcp: use 0 as the value being ignored
No functional change intended.

Sponsored by:	Netflix, Inc.

(cherry picked from commit 36ba7339d4df0803f8e0655e2ba8d174d4ccec38)
2025-09-08 10:29:27 +02:00
Michael Tuexen
3627125eb2 tcp: fix handling of TIME WAIT for local TCP connections
The sysctl-variable net.inet.tcp.nolocaltimewait should affect
TCP connections where the remote endpoint is on the local host and
not on the local area network.

Reported by:		cc
Reviewed by:		cc
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D50830

(cherry picked from commit 49eabd405f661fa3a9f0a005c2e54dc4cad07e48)
2025-09-08 10:29:22 +02:00
Gordon Bergling
0fce0e3984 mod_cc(4): Fix a typo in a source code comment
- s/assigments/assignments/

(cherry picked from commit 88ed58d7f88471dc69e943e94d420cd4ef090042)
2025-09-08 10:27:55 +02:00
Gordon Bergling
ee0306bc3d udp: Fix a typo in a source code comment
- s/datgram/datagram/

(cherry picked from commit a3a78bd7a7446a9a437391c681ba196d956987da)
2025-08-26 10:25:34 +02:00
Mark Johnston
b79aff126e udp: Fix a inpcb refcount leak in the tunnel receive path
When the socket has a tunneling function attached, udp_append() drops
the inpcb lock before calling it.  To keep the inpcb alive, we bump the
refcount.  After commit 742e7210d0 we only dropped the reference if
the tunnel consumed the packet, but it needs to be dropped in either
case.  if_ovpn is the only driver that can trigger this bug.

Fixes:		742e7210d0 ("udp: allow udp_tun_func_t() to indicate it did not eat the packet")
Reviewed by:	kp
MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D51505

(cherry picked from commit e1751ef896119d7372035b1b60f18a6342bd0e3b)
2025-08-13 08:52:28 +02:00
Kristof Provost
a33722184c pfil: set PFIL_FWD for IPv4 forwarding
Just like we already do for IPv6 set the PFIL_FWD flag when we're forwarding
IPv4 traffic. This allows firewalls to make more precise decisions.

Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D48824
2025-07-09 10:05:51 +02:00
Kristof Provost
da66e273ff pfil: PFIL_PASS never frees the mbuf
pfil hooks (i.e. firewalls) may pass, modify or free the mbuf passed
to them. (E.g. when rejecting a packet, or when gathering up packets
for reassembly).

If the hook returns PFIL_PASS the mbuf must still be present. Assert
this in pfil_mem_common() and ensure that ipfilter follows this
convention. pf and ipfw already did.
Similarly, if the hook returns PFIL_DROPPED or PFIL_CONSUMED the mbuf
must have been freed (or now be owned by the firewall for further
processing, like packet scheduling or reassembly).

This allows us to remove a few extraneous NULL checks.

Suggested by:	tuexen
Reviewed by:	tuexen, zlei
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43617
2025-07-09 10:05:50 +02:00
Franco Fichtner
0362a8af23 pf|ipfw|netinet6?: shared IP forwarding
This removes the if_output calls in the pf(4) code that escape further
processing by defering the forwarding execution to the network stack
using on/off style sysctls for both IPv4 and IPv6.

Also see: https://reviews.freebsd.org/D8877
2025-07-09 10:05:49 +02:00
Stephan de Wit
0d1029fedb rss: add sysctl enable toggle
This commit also includes the original refactoring changes

This change allows the kernel to operate with the default netisr cpu-affinity settings while having RSS compiled in. Normally, RSS changes quite a bit of the behaviour of the kernel dispatch service - this change allows for reducing impact on incompatible hardware while preserving the option to boost throughput speeds based on packet flow CPU affinity.

Make sure to compile the following options in the kernel:

    options  RSS

As well as setting the following sysctls:

    net.inet.rss.enabled: 1
    net.isr.bindthreads: 1
    net.isr.maxthreads: -1 (automatically sets it to the number of CPUs)

And optionally (to force a 1:1 mapping between CPUs and buckets):

    net.inet.rss.bits: 3 (for 8 CPUs)
    net.inet.rss.bits: 2 (for 4 CPUs)

etc.

Set pin_default_swi to 0 by default in the RSS case.
2025-07-09 10:05:48 +02:00
Xavier Beaudouin
cf6903fa99 Add UDP encapsulation of ESP in IPv6
This patch provides UDP encapsulation of ESP packets over IPv6.
Ports the IPv4 code to IPv6 and adds support for IPv6 in udpencap.c
As required by the RFC and unlike in IPv4 encapsulation,
UDP checksums are calculated.

Co-authored-by:	Aurelien Cazuc <aurelien.cazuc.external@stormshield.eu>
Sponsored-by:	Stormshield
Sponsored-by:	Wiktel
Sponsored-by:	Klara, Inc.

Fix KASSERT in 80044c78 causing build failures

Move the KASSERT to where struct ip6_hdr is populated

Fixes:		80044c785cb040a2cf73779d23f9e1e81a00c6c3
Reported-by:	bapt
Reviewed-by:	markj
Sponsored-by:	Klara, Inc.
2025-07-09 10:05:48 +02:00
Franco Fichtner
26c5cf989f dummynet: passin after dispatch
Based on a patch originally found in m0n0wall, expanded
to IPv6 and aligned with FreeBSD's IP input path.

The limit may not be correctly accounted for on the WAN
interface due to dummynet counting the packet again even
though it was already processed.

The problem here is that there's no proper way to reinject
the packet at the point where it was previously removed
from so we make the assumption that ip input was already
done (including pfil) and more or less directly move to
packet output processing.

While here move the passin label up to take the extra check
but avoiding a second label.  Also remove the spurious tag
read for forward check since we don't use it and we should
really trust the mbuf flag.
2025-07-09 10:05:47 +02:00
Michael Tuexen
4d71997277 sctp: ensure correct sctp_gather_internal_ifa_flags usage
sctp_gather_internal_ifa_flags() expects an IPv6 address.

(cherry picked from commit 4ca1395c5a311989fc02ceb7a2d44aa5eb1a7426)
2025-07-09 10:05:42 +02:00
Michael Tuexen
eae6f294e7 sctp: fix mapping of interface address flags
Do not clear the SCTP_ADDR_IFA_UNUSEABLE flag, if it was set due
to the address being deprecated. Also don't declare tentative
addresses as unusable.
While there, cleanup the code.

PR:		230242

(cherry picked from commit 9639de2a6f7eec8b2158782fbfab3419d507fdc5)
2025-07-09 10:05:41 +02:00
Michael Tuexen
fb61ebb847 sctp: compute address flags only for IPv6 addresses
Only call sctp_gather_internal_ifa_flags() for IPv6 addresses and
also compile this code only, when IPv6 is supported.
This fixes the compilation of IPv4 only kernels.

Reported by:	bz@
Fixes:		6ab4b0c0df57 ("sctp: initilize local address flags correctly")

(cherry picked from commit 99c58ad021b2f7dc0496e16d313c5e28a552f0d0)
2025-07-09 10:05:41 +02:00
Michael Tuexen
f8b82ca421 sctp: clear the SCTP_ADDR_VALID flag when removing an address
This flag is currently not read, therefore the bug had no
consequences.

(cherry picked from commit 2013c4e0dc73a7c7b05f48726af1a4931686ccef)
2025-07-09 10:05:41 +02:00
Michael Tuexen
604046c446 sctp: initilize local address flags correctly
Use the same routine for initilizing as for updating.

(cherry picked from commit 6ab4b0c0df57775fd6c288a0b7d0f5d2cad73481)
2025-07-09 10:05:41 +02:00
Michael Tuexen
4086518894 sctp: report address unavailability consistently
When binding to an address, which is not available, use
consistently EADDRNOTAVAIL.

(cherry picked from commit 79952cd7649b63fa312ecafcffb719f5060929d4)
2025-07-09 10:05:41 +02:00
Michael Tuexen
3906c9fd23 sctp: don't report unusable addresses via sysctl interface
When reporting the local addresses of an endpoint (inp without
stcb), ignore unusable addresses.

(cherry picked from commit 8f5f6680efa28135bf37f3def2aa71f35bd30333)
2025-07-09 10:05:41 +02:00
Lexi Winter
cd5b92eb56 bridge: allow IP addresses on members to be disabled
add a new sysctl, net.link.bridge.member_ifaddrs, which defaults to 1.

if it is set to 1, bridge behaviour is unchanged.

if it is set to 0:

- an interface which has AF_INET6 or AF_INET addresses assigned cannot
  be added to a bridge.
- an interface in a bridge cannot have an AF_INET6 or AF_INET address
  assigned to it.
- the bridge will no longer consider the lladdrs on bridge members to be
  local addresses, i.e. frames sent to member lladdrs will not be
  processed by the host.

update bridge.4 to document this behaviour, as well as the existing
recommendation that IP addresses should not be configured on bridge
members anyway, even if it currently partially works.

in testing, setting this to 0 on a bridge with 50 member interfaces
improved throughput by 22% (4.61Gb/s -> 5.67Gb/s) across two member
epairs due to eliding the bridge member list walk in GRAB_OUR_PACKETS.

Reviewed by:	kp, des
Approved by:	des (mentor)
Differential Revision:	https://reviews.freebsd.org/D49995

(cherry picked from commit 0a1294f6c610948d7447ae276df74a6d5269b62e)
2025-07-09 10:05:41 +02:00
Mark Johnston
399bc0c182 netinet: Make in_systm.h self-contained
PR:		286539
MFC after:	3 days
Approved by:	re (cperciva)

(cherry picked from commit 75d173a84836d14b12a0f747ffed7d37766dd274)
(cherry picked from commit 02dde7c43fe76a5dcdc170de1c2740a31629e106)
2025-05-07 12:04:59 +00:00
Michael Tuexen
976aa65e3e tcp: improve KASSERT in limited retransmit
When doing a limited retransmit, allow up to 2 * MSS - 1 if the
Nagle algorithm has been disabled.

PR:			282605
Approved by:		re (cperciva)
Reviewed by:		cc, Peter Lei
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D49922

(cherry picked from commit 934caaec3afc43638c2a1da8fbe3b672566db4fe)
(cherry picked from commit 0906658c3409996b26518e67df48c01052ef934c)
2025-05-06 21:18:24 +02:00
Peter Lei
7655a4141e tcp: clear blackbox logging union
Clear the black box logging containing union rather than the u_bbr
structure for clarity and consistency. Currently u_bbr, u_raw, and
u64_raw are the same size.
No functional change intended.

Reviewed by:	tuexen
Sponsored by:	Netflix, Inc.

(cherry picked from commit 382af4d38b62675f00f64275793a6b5fccfe62fa)
2025-05-01 22:07:40 +02:00
Michael Tuexen
a9114926e2 tcp rack: cleanup storing values for beta and beta_ecn
beta and beta_ecn were stored using a variable of type struct newreno
in struct rack_control. Later, struct newreno was extended and now
contains several more fields.
This results in a memory inefficiency and also in copying around
uninitialized memory.
This patch fixes this by storing beta and beta_ecn individually in
struct rack_control.
Please note that the newreno_flags field was only stored and never
used. Therefore, this is not stored anymore in struct rack_control.
No functional change intended.

CID:			1523796
Reviewed by:		rrs
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D49578

(cherry picked from commit f6deb9ea0a0ee760e5ff9ad5c15d0bd7a1714355)
2025-05-01 21:52:31 +02:00
Michael Tuexen
25f9717663 tcp: cleanup
Remove the macros COPY_STAT and COPY_STAT_T, since they do not improve
the readability of the code. No functional change intended.
Thanks to glebius@ for suggesting the change.

Reviewed by:		glebius, rrs
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D49670

(cherry picked from commit 46fc12741e70f2d1f0510a0dacd2f9dd3aa116c0)
2025-05-01 20:51:05 +02:00
Mark Johnston
b48ad95e67 netinet: Make ip.h self-contained
In general we are working towards making public headers self-contained.

cdefs.h is included for __packed; just assume that types.h includes
cdefs.h as that's a very common assumption.

PR:		285924
Reviewed by:	emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D49735

(cherry picked from commit 31d3a94bdda4a9ca4c4d7d4e8e8a0ba1b05c7f18)
2025-04-24 13:20:57 +00:00
Michael Tuexen
4c07ee6a5e tcp: remove struct tcp_log_rack
struct tcp_log_rack is not used, therefore remove it.

Reviewed by: 		Peter Lei
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D49669

(cherry picked from commit b1c62081feec535a4f2eeb4f8deb58913d9e281c)
2025-04-07 14:56:25 +02:00
Peter Lei
aa1c5de9d2 tcp: clear sendfile logging struct
The sendfile black box logging struct is much smaller than the
encompassing stack specific logging union. Be sure to clear the
trailing unused memory when logging.

Reviewed by:	tuexen
Sponsored by:	Netflix, Inc.

(cherry picked from commit 3bd1e85fc13cb90853046300dcaa31d63b45ee21)
2025-04-07 14:54:52 +02:00
Peter Lei
cc52d73deb tcp: fix typos in comment
Reviewed by:	tuexen
Sponsored by:	Netflix, Inc.

(cherry picked from commit 2a0d26d793b2ff63d36305aa98047a4bc6a6cd8c)
2025-04-07 14:53:52 +02:00
Michael Tuexen
b95d16f39d tcp: improve initializing the fields in tcp_log_buffer
Initialize the fields in the tcp_log_buffer in the sequence they
appear in the structure and add the initialization of tlb_flex1,
tlb_flex2, and _pad[].

Reviewed by:		rrs, Peter Lei
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D49652

(cherry picked from commit 94acddd2ad0142221124c3fb7fe3778a5a1f8036)
2025-04-07 14:53:07 +02:00
Michael Tuexen
47c7dcfe2b sctp: fix double unlock in case adding a remote address fails
Thanks to glebius@ for pointing to the problem.

Reported by:	syzbot+1d5c164f1c10de84ad8a@syzkaller.appspotmail.com
Fixes:		2d5c48eccd ("sctp: Tighten up locking around sctp_aloc_assoc()")

(cherry picked from commit e8623834ca29b562687db945bdd12a3e2fe4aeb1)
2025-04-07 14:51:00 +02:00
Peter Lei
cf3fb40d55 tcp rack: cleanup accounting conditional checks
No functional change intended.

Reviewed by:	tuexen
Sponsored by:	Netflix, Inc.

(cherry picked from commit 6f27541d948fa0126f9262f8cc5326b1c4befcc7)
2025-04-07 14:45:37 +02:00
Mark Johnston
85ff908020 netinet: Fix getcred sysctl handlers to do nothing if no input is given
These routines were all assuming that the sysctl handler has some new
value, but this is not the case.  SYSCTL_IN() returns 0 in this
scenario, so they were all operating on an uninitialized address.  This
is mostly harmless, but trips KMSAN checks, so let's fix them.

Reviewed by:	zlei, rrs, glebius
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D49348

(cherry picked from commit 3ff865c6a7948b2cfc01d7056c619145b696700a)
2025-04-06 13:54:03 +00:00
Michael Tuexen
e754d89bba tcp: fix detection of bad RTOs
If timestamps are enabled, the actions performed by a retransmission
timeout were rolled back, when they should not.
It is needed to make sure the incoming segment advances SND.UNA.
To do this, remove the incorrect upfront check and extend the check in
the fast path to handle also the case of timestamps.

PR:			282605
Reviewed by:		cc, rscheff, Peter Lei
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D49414

(cherry picked from commit fbcf3b74e8f2c0c5ba37f1839bfe9395eb2fd0b1)
2025-04-04 11:05:10 +02:00
Gleb Smirnoff
1bda3fae78 tcp: don't ever return ECONNRESET on close(2)
The SUS doesn't mention this error code as a possible one [1]. The FreeBSD
manual page specifies a possible ECONNRESET for close(2):

[ECONNRESET]	The underlying object was a stream socket that was
		shut down by the peer before all pending data was
		delivered.

In the past it had been EINVAL (see 21367f630d), and this EINVAL was
added as a safety measure in 623dce13c6.  After conversion to
ECONNRESET it had been documented in the manual page in 78e3a7fdd5, but
I bet wasn't ever tested to actually be ever returned, cause the
tcp-testsuite[2] didn't exist back then.  So documentation is incorrect
since 2006, if my bet wins.  Anyway, in the modern FreeBSD the condition
described above doesn't end up with ECONNRESET error code from close(2).
The error condition is reported via SO_ERROR socket option, though.  This
can be checked using the tcp-testsuite, temporarily disabling the
getsockopt(SO_ERROR) lines using sed command [3].  Most of these
getsockopt(2)s are followed by '+0.00 close(3) = 0', which will confirm
that close(2) doesn't return ECONNRESET even on a socket that has the
error stored, neither it is returned in the case described in the manual
page.  The latter case is covered by multiple tests residing in tcp-
testsuite/state-event-engine/rcv-rst-*.

However, the deleted block of code could be entered in a race condition
between close(2) and processing of incoming packet, when connection had
already been half-closed with shutdown(SHUT_WR) and sits in TCPS_LAST_ACK.
This was reported in the bug 146845.  With the block deleted, we will
continue into tcp_disconnect() which has proper handling of INP_DROPPED.

The race explanation follows.  The connection is in TCPS_LAST_ACK.  The
network input thread acquires the tcpcb lock first, sets INP_DROPPED,
acquires the socket lock in soisdisconnected() and clears SS_ISCONNECTED.
Meanwhile, the syscall thread goes through sodisconnect() which checks for
SS_ISCONNECTED locklessly(!).  The check passes and the thread blocks on
the tcpcb lock in tcp_usr_disconnect().  Once input thread releases the
lock, the syscall thread observes INP_DROPPED and returns ECONNRESET.

- Thread 1: tcp_do_segment()->tcp_close()->in_pcbdrop(),soisdisconnected()
- Thread 2: sys_close()...->soclose()->sodisconnect()->tcp_usr_disconnect()

Note that the lockless operation in sodisconnect() isn't correct, but
enforcing the socket lock there will not fix the problem.

[1] https://pubs.opengroup.org/onlinepubs/9799919799/
[2] https://github.com/freebsd-net/tcp-testsuite
[3] sed -i "" -Ee '/\+0\.00 getsockopt\(3, SOL_SOCKET, SO_ERROR, \[ECONNRESET\]/d' $(grep -lr ECONNRESET tcp-testsuite)

PR:			146845
Reviewed by:		tuexen, rrs, imp
Differential Revision:	https://reviews.freebsd.org/D48148

(cherry picked from commit 053a988497342a6fd0a717cc097d09c23f83e103)
2025-03-31 10:31:21 -07:00
Richard Scheffenegger
4a328b8049 tcp: fix reverting of spurious timeouts (RTO)
One variable that became critical to correctly calculate
the cwnd during limited transmit was not properly reverted
on detection of spurious timeouts.

PR:			282605
Reviewed By:		cc, tuexen, #transport
MFC after:		3 days
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D48652

(cherry picked from commit 6f6c07813b38ab04d8b1b2bb87c0291dbae25a25)
2025-03-24 06:35:43 +01:00
Konstantin Belousov
be425fcdc6 ip_output(): style
(cherry picked from commit 394605c057ade77775e1f9975e278dbb7693f44f)
2025-03-17 02:48:33 +02:00
Konstantin Belousov
9de58ca100 ip_output(): if mb_unmapped_to_ext() failed, return directly
(cherry picked from commit edc1fba05e055a1943efd969d77c0acf0fbff587)
2025-03-17 02:48:32 +02:00
Zhenlei Huang
140c473fb9 tcp_ratelimit: Use static initializers
MFC after:	1 week

(cherry picked from commit 09de37310313d87942fc5349914be46b9cb8c808)
2025-03-13 18:13:51 +08:00
Zhenlei Huang
dbb5216e03 carp: Use static initializers
MFC after:	1 week

(cherry picked from commit b7d5bda6f109e09d8999283a9b4e4a9668df9de9)
2025-03-13 18:13:50 +08:00