Commit Graph

270590 Commits

Author SHA1 Message Date
Gleb Smirnoff
ad2a0aec29 nhop: hash ifnet pointer instead of if_index
Yet another problem created by VIMAGE/if_vmove/epair design that
relocates ifnet between vnets and changes if_index.  Since if_index
changes, nhop hash values also changes, unlink_nhop() isn't able to
find entry in hash and leaks the nhop.  Since nhop references ifnet,
the latter is also leaked.  As result running network tests leaks
memory on every single test that creates vnet jail.

While here, rewrite whole hash_priv() to use static initializer,
per Alexander's suggestion.

Reviewed by:	melifaro
2021-12-04 10:05:46 -08:00
Michael Tuexen
c2b53b107e tcpdrop: tweak comments
MFC after:	1 week
Sponsored by:	Netflix, Inc.
2021-12-04 15:08:01 +01:00
Michael Tuexen
8ea363c8c6 tcpdrop: explicitly choose TCP as the transport protocol
MFC after:	1 week
Sponsored by:	Netflix, Inc.
2021-12-04 15:03:29 +01:00
Michael Tuexen
31537ea583 tcpdrop: allow TCP connections to be filtered by cc-algo
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.

MFC after:	1 week
Sponsored by:	Netflix, Inc.
2021-12-04 15:02:15 +01:00
Cy Schubert
130df64793 ipfilter: Avoid more null if-then-else blocks
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.

MFC after:	3 days
2021-12-04 06:33:13 -08:00
Cy Schubert
1ca73c39a5 ipfilter: Correct a comment and add notation
Correct a comment to accurately reflect what is being done. While
we're at it document the next step in the process.

MFC after:	3 days
2021-12-04 06:33:13 -08:00
Cy Schubert
06b96a4bd6 ipfilter: Correct function description
As of 874b1a3548, ip_proxy_check() return codes have been simplified.
The original comment was also incorrect in the first place.

MFC after:	3 days
2021-12-04 06:33:13 -08:00
Cy Schubert
106f42596e ipfilter: Add DTrace SDT probe
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.

MFC after:	3 days
2021-12-04 06:33:12 -08:00
Cy Schubert
ca8bf28e1e ipfilter: New DT5 DTrace macro
Define a new DT5 DTrace macro used to call DTRACE_PROBE5, for use with
SDT probes with five arguments.

MFC after:	3 days
2021-12-04 06:33:12 -08:00
Cy Schubert
fca9c3871d ipfilter: Whitespace cleanup
Clean up whitespace from compaction of DTn macro definitions.

MFC after:	3 days
2021-12-04 06:33:12 -08:00
Cy Schubert
2d74fed5be ipfilter: Compat and simplify DTrace macro definitions
Use a compound #if to simplify and compact DTn DTRACE_PROBEn macros
used by ipfilter.

MFC after:	3 days
2021-12-04 06:33:12 -08:00
Cy Schubert
b7f127b6e5 ipfilter: Save a word of stack space
Rather than save the return code into an intermediate variable, which BTW
is optimized out anyway, explicitly remove the return code from the stack.

MFC after:	3 days
2021-12-04 06:33:12 -08:00
Michael Tuexen
7ef45bd3cf tcpdrop: update man page, since the fastack stack has been removed
MFC after:	1 week
Sponsored by:	Netflix, Inc.
2021-12-04 14:27:46 +01:00
Michael Tuexen
300914a0ff tcpdrop: use a better name of a variable.
No functional change intended.

MFC after:	1 week
Sponsored by:	Netflix, Inc.
2021-12-04 13:48:41 +01:00
Gordon Bergling
42efe994ec ffs(3): Fix a typo in a sysctl description
- s/contigous/continuous/

MFC after:	3 days
2021-12-04 12:15:34 +01:00
Gordon Bergling
b86066a15e omap4: Fix a few typos in source code comments
- s/addresss/address/

MFC after:	3 days
2021-12-04 12:13:27 +01:00
Gordon Bergling
e10ac08631 ipfilter(4): Fix a typo in an error message
- s/addresss/address/

This is a direct commit to contrib since the upstream is
no longer active.

MFC after:	3 days
2021-12-04 12:10:39 +01:00
Gordon Bergling
a9beea0511 net80211(4): Fix a typo in a sysctl description
- s/travelse/traversal/

MFC after:	3 days
2021-12-04 12:09:17 +01:00
Kristof Provost
6d4baa0d01 if_pflog: fix packet length
There were two issues with the new pflog packet length.
The first is that the length is expected to be a multiple of
sizeof(long), but we'd assumed it had to be a multiple of
sizeof(uint32_t).

The second is that there's some broken software out there (such as
Wireshark) that makes incorrect assumptions about the amount of padding.
That is, Wireshark assumes there's always three bytes of padding, rather
than however much is needed to get to a multiple of sizeof(long).

Fix this by adding extra padding, and a fake field to maintain
Wireshark's assumption.

Reported by:	Ozkan KIRIK <ozkan.kirik@gmail.com>
Tested by:	Ozkan KIRIK <ozkan.kirik@gmail.com>
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D33236
2021-12-04 08:42:55 +01:00
Scott Long
98470f0e0b Fix "set but not used" in mrsas. This includes removing unnecessary cdevsw
methods.

Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-04 00:08:27 -07:00
Scott Long
2d5d242406 Fix "set but not used" for geom
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-03 23:40:24 -07:00
Scott Long
1c64538f58 Fix "set but not used" for bge
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-03 23:29:51 -07:00
Robert Wing
fc21aafe5f ipsec: fix a panic with INVARIANTS
When adding an SPD entry that already exists, a refcount wraparound
panic is encountered. This was caused from dropping a reference on the
wrong security policy.

Fixes:          4920e38fec ("ipsec: fix race condition in key.c")
Reviewed by:	wma
Sponsored by:   Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D33100
2021-12-03 14:22:23 -09:00
Scott Long
a21f086a33 Fix "set but not used" in the tws driver
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-03 15:40:29 -07:00
Scott Long
74765431b7 Fix "set but not used" for the ti driver
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-03 15:31:14 -07:00
Scott Long
bca8e8c00c Fix "set but not used" in arcmsr
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-03 15:26:57 -07:00
Scott Long
d85a58cb0c Fix "set but not used" in busdma_bounce.
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-03 15:20:42 -07:00
Scott Long
5045cb8f18 Fix "set but not used" for the sym driver.
Sponsored by: Rubicon Communications, LLC ("Netgate")
2021-12-03 15:18:39 -07:00
Michael Tuexen
d79676fb13 sctp: inherit IP level socket options from listening socket
Ensure that TTL and TOS values set on a listener get inheritet
to the accepted sockets.

PR:		260119
MFC after:	1 week
2021-12-03 22:44:01 +01:00
Gleb Smirnoff
36f42c5ebf tcp_ccalgounload(): initialize the inpcb iterator when curvnet is set
Pointy hat to:	glebius
Fixes:		de2d47842e
2021-12-03 12:39:56 -08:00
Peter Lei
4c018b5aed in_pcb: limit the effect of wraparound in TCP random port allocation check
The check to see if TCP port allocation should change from random to
sequential port allocation mode may incorrectly cause a false positive
due to negative wraparound.
Example:
    V_ipport_tcpallocs = 2147483585 (0x7fffffc1)
    V_ipport_tcplastcount = 2147483553 (0x7fffffa1)
    V_ipport_randomcps = 100
The original code would compare (2147483585 <= -2147483643) and thus
incorrectly move to sequential allocation mode.

Compute the delta first before comparing against the desired limit to
limit the wraparound effect (since tcplastcount is always a snapshot
of a previous tcpallocs).
2021-12-03 12:38:12 -08:00
Michael Tuexen
f32357be53 sctp: use the correct traffic class when sending SCTP/IPv6 packets
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
2021-12-03 21:36:44 +01:00
Peter Lei
13e3f3349f in_pcb: fix TCP local ephemeral port accounting
Fix logic error causing UDP(-Lite) local ephemeral port bindings
to count against the TCP allocation counter, potentially causing
TCP to go from random to sequential port allocation mode prematurely.
2021-12-03 12:30:21 -08:00
Eric Joyner
5577aa338a
iavf(4): Include RSS header file when RSS is defined
This should unbreak the kernel build when "options RSS" is
defined in the kernel configuration, and make the feature work.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reported by:	adrian@
Sponsored by:	Intel Corporation
2021-12-03 12:02:42 -08:00
Chuck Silvers
dfd00261c9 librtld_db: Handle shlibs with discontiguous mappings.
Some shared libraries specify mappings that leave a gap (actually a
MAP_GUARD mapping) in between the file mappings (libcrypto.so was
the one I found), and this would cause rd_loadobj_iter() to report
the mapping info incorrectly, leaving out rdl_path and misreporting
rdl_offset for file mappings after the gap.  Fix rd_loadobj_iter()
to handle this situation.

Reviewed by:	markj
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D32950
2021-12-03 11:07:30 -08:00
Gleb Smirnoff
ae04d30451 ng_l2tp: use callout_reset() instead of ng_callout()
The previous commit to this node falsely stated that locked callouts
are compatible with netgraph ng_callout KPI.  They are not.  An item
can be queued instead of being applied to the node, which results in
a mutex leak to the callout thread and later unlocked call into function
that expects to be called locked.

Potentially netgraph can be taught to handle locked callouts, but that
would bring a lot of complexity in it.  Instead lets question necessity
of ng_callout() instead of callout_reset().  It protects against node
going away while callout is scheduled.  But a node that drains all
callouts in the shutdown method (ng_l2tp does) is already protected.

Fixes:	89042ff776
2021-12-03 08:57:23 -08:00
Fabian Keil
5f034a0054 fstab.5: spell encryption correctly
PR:	260189
MFC after:	2 weeks
2021-12-03 16:28:46 +00:00
Arnaud Ysmal
ea68079ffd Suport Q-in-Q for mvneta. 2021-12-03 11:06:58 +01:00
Konstantin Belousov
a5c2d59ed3 Expand comment explaining reasons for automatic swapoff on shutdown
Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33167
2021-12-03 10:42:21 +02:00
Cy Schubert
24e3652200 unbount: Vendor import 1.14.0rc1
This vendor import was requested by glebius@ as it should fix unbound
crashes.

Reported by:	glebius
MFC after:	1 week
2021-12-02 22:11:04 -08:00
Cy Schubert
68965ba955 unbound: Vendor import 1.14.0rc1
This vendor import was requested by glebius@ as it should fix unbound
crashes.

Reported by:	glebius
2021-12-02 21:35:06 -08:00
Gleb Smirnoff
12ae3476f3 tcp_drain(): initialize the inpcb iterator when curvnet is set
Reported by:	cy
Pointy hat to:	glebius
Fixes:		de2d47842e
2021-12-02 21:08:30 -08:00
Gleb Smirnoff
651a545143 udp_detach(): fix set but not used warning 2021-12-02 20:12:40 -08:00
Gleb Smirnoff
bd1d085045 udp_multi_input(): the UDP header is only needed for probes
Reported by:	kib
Fixes:		de2d47842e
2021-12-02 20:12:40 -08:00
Gleb Smirnoff
4b4cce02ac xhci: add PCI IDs for USB controllers found on Supermicro M12SWA-TF 2021-12-02 20:12:33 -08:00
Alan Somers
c2d342c509 fusefs: better debugging for FUSE_RENAME in the tests
MFC after:	2 weeks
2021-12-02 20:26:27 -07:00
John Baldwin
60a8277413 Only use OLD_LIBS with shared libraries.
Use OLD_FILES for a few symbolic links and static libraries previously
included in OLD_LIBS.

Add a missing shared library major number to an old libroken entry.
2021-12-02 17:30:00 -08:00
Mateusz Piotrowski
5e077e08ef style.mdoc: Prefer Ql to Dq Li for literal display
The Li macros has been deprecated by mdoc some time ago. Recommend the
use of Ql instead.

Reviewed by:	debdrup
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33232
2021-12-03 02:11:04 +01:00
Herbert J. Skuhra
a58135eb09 OptionalObsoleteFiles.inc: Add rc.d/zfskeys
While here, sort the etc/rc.d entries.

PR:		256483
Reviewed by:	allanjude
Approved by:	allanjude (src)
MFC after:	3 days
Sponsored by:	Modirum MDPay
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D33238
2021-12-03 02:05:55 +01:00
Cy Schubert
4b72b91a71 wpa: Redo import wpa_supplicant/hostapd commit 14ab4a816
This is the November update to vendor/wpa committed upstream 2021-11-26.

MFC after:	1 month
2021-12-02 15:08:52 -08:00