When attempting to characterize bound addresses, netstat was checking
for host 0 on a (historical) net using inet_lnaof(). Such addresses
are not normally bound, as they would not work, with the exception
of the unspecified address, INADDR_ANY. Check for that explicitly.
Similarly, don't check bound addresses for a match to a network name.
(cherry picked from commit bd27c71c45)
The exports file format allows export to a network using an explicit
mask or prefix length (CIDR). It also allows a network with just
a dotted address, in which case the historical mask was used.
Deprecate this usage, and warn when it is used. Document that this
is deprecated.
(cherry picked from commit 92aebdeaff)
Mark functions inet_netof(), inet_lnaof(), and inet_makeaddr() as
deprecated, as they assume Class A/B/C. inet_makeaddr() mostly works
when networks are a multiple of 8 bits, but warn for anything other
than historical classes. Reduce other mentions of network classes.
(cherry picked from commit 12bd931d8c)
Add a postproc function for af_inet, and add interface flags as a
parameter. Check there if setting an address without a mask unless
the interface is loopback or point-to-point, where mask is not really
meaningful; warn if so. This will hopefully be an error in the future.
(cherry picked from commit d8237b9555)
Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is defined;
define it for user level. Define IN_MULTICAST separately from IN_CLASSD,
and use it in pf instead of IN_CLASSD. Stop using class for setting
default masks when not specified; instead, define new default mask
(24 bits). Warn when an Internet address is set without a mask.
(cherry picked from commit 20d5940396)
iflib_stop modifies iflib data structures that are used by _task_fn_rx,
most prominently the free lists. So, iflib_stop has to ensure that the
rx task threads are not active.
This should help to fix a crash seen when iflib_if_ioctl (e.g.,
SIOCSIFCAP) is called while there is already traffic flowing.
The crash has been seen on VMWare guests with vmxnet3 driver.
My guess is that on physical hardware the couple of 1ms delays that
iflib_stop has after disabling interrupts are enough for the queued work
to be completed before any iflib state is touched.
But on busy hypervisors the guests might not get enough CPU time to
complete the work, thus there can be a race between the taskqueue
threads and the work done to handle an ioctl, specifically in iflib_stop
and iflib_init_locked.
PR: 259458
(cherry picked from commit 1bfdb812c7)
twsi_error() is a new function that stops the current transfer and sets
up softc when an error condition is detected.
TWSI_STATUS_DATA_WR_NACK, TWSI_STATUS_BUS_ERROR and
TWSI_STATUS_ARBITRATION_LOST are now handled explicitly rather than
via the catch-all unknown status.
Also, twsi_intr() now calls wakeup() in a single place when the
transfer is finished.
(cherry picked from commit a4fe892208)
All accesses to softc are now done under a mutex to prevent data races
between the open context and the interrupt handler.
Additionally, the wait time in twsi_transfer is bounded now.
Previously we could get stuck there forever if an interrupt got lost.
(cherry picked from commit 69cfa60ddd)
In addition to filtering by stack and state, allow filtering
by the congestion control module used. Choose the command line
options to be consistent with the ones of sockstat.
Sponsored by: Netflix, Inc.
(cherry picked from commit 31537ea583)
Ensure that TTL and TOS values set on a listener get inheritet
to the accepted sockets.
PR: 260119
MFC after: 1 week
(cherry picked from commit d79676fb13)
When sending packets the stcb was used to access the inp and then
access the endpoint specific IPv6 level options. This fails when
there exists an inp, but no stcb yet. This is the case for sending
an INIT-ACK in response to an INIT when no association already
exists. Fix this by just providing the inp instead of the stcb.
PR: 260120
MFC after: 1 week
(cherry picked from commit f32357be53)
When there is no association, don't return -1 and indicate ENOENT,
but return 0 instead. This is specified in RFC 6458.
PR: 260117
MFC after: 1 week
(cherry picked from commit 83a103ec42)
Section 9.5 of RFC 6458 (SCTP Socket API) requires that
sctp_getladdrs() returns 0 in case the socket is unbound. This
is the cause of reporting 0 addresses. So don't indicate an
error, just report this case as required.
PR: 260117
MFC after: 1 week
(cherry picked from commit 071966e874)
For socket options related to local and remote addresses providing
generic association ids does not make sense. Report EINVAL in this
case.
MFC after: 1 week
(cherry picked from commit 13c196a41e)
When calling getsockopt() with SCTP_GET_LOCAL_ADDR_SIZE, use a
pointer to a 32-bit variable, since this is what the kernel
expects.
While there, do some cleanups.
MFC after: 1 week
(cherry picked from commit dabd8bf914)
For a LayoutReturn when using the Flexible File Layout,
error reports may be provided in the request.
Sanity check the size of these error reports and
check that they exist before calling nfsrv_flexlayouterr().
PR: 260012
(cherry picked from commit bdd57cbb1b)
As in 73db3b64f1, when WITHOUT_INET6 is selected, null if-then-else
blocks are generated because #if statements are incorrectly placed.
Moving the #if statements reduces unnecessary runtime comparisons or
compiler optimizations.
(cherry picked from commit 130df64793)
Correct a comment to accurately reflect what is being done. While
we're at it document the next step in the process.
(cherry picked from commit 1ca73c39a5)
As of 874b1a3548, ip_proxy_check() return codes have been simplified.
The original comment was also incorrect in the first place.
(cherry picked from commit 06b96a4bd6)
Add an SDT probe, using the newly created DT5 macro, in similar vein
to DEBUG_PARSE printf for when FTP junk is anticipated and ok. This
will assist in debugging port (active) FTP proxy issues.
(cherry picked from commit 106f42596e)
Rather than save the return code into an intermediate variable, which BTW
is optimized out anyway, explicitly remove the return code from the stack.
(cherry picked from commit b7f127b6e5)
While here:
- Cluster flags without arguments together.
- Simplify the synopsis of the -a flag. There is no need to distinguish
between address and hostname there.
- Add a missing argument to the -a flag in the description section.
- Fix some typos.
MFC after: 3 days
(cherry picked from commit 593ad024e4)
Contrary to the previous description WITHOUT_CXX does not disable
/usr/bin/c++, which is just a link to Clang. We also no longer have
gperf.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 145a574fa1)
Since revision 3.0 this structure grown another field, breaking access
to the following data structures. This change fixes the PCIe errors
decoding on newer systems.
MFC after: 2 weeks
(cherry picked from commit ba83762a62)