ping6: fix outpack overflow in pattern fill loop
The fill loop was bounded by packlen, which is sized for the receive
buffer (datalen + IP6LEN + ICMP6ECHOLEN + EXTRA), not for outpack.
With large datalen the loop wrote past outpack[MAXPACKETLEN].
Bound it to the actual data area in outpack instead.
Reported by: Oculytic
Reviewed by: des, markj
Differential Revision: https://reviews.freebsd.org/D57441
Merge commit 93a67259cf23 from llvm git (by ShengYi Hung):
[ToolChains][FreeBSD] Set default Linker to LLD for FreeBSD (#190596)
When the linker is specified as ld, toolchain applies special handling
by invoking (triple)-ld instead of resolving ld via standard PATH
lookup. This causes GNU ld installed via the system package manager to
take the precedence (since (triple)-ld appears earlier in the search
path), effectively overriding ld.lld.
As a result, we set the default Linker on FreeBSD to ld.lld to indicate
we want to use lld by default.
PR: 292067
MFC after: 3 days
(cherry picked from commit 2b619b7c7b5300cbaf59e4e9d75bc8472df014e9)
Merge commit 93a67259cf23 from llvm git (by ShengYi Hung):
[ToolChains][FreeBSD] Set default Linker to LLD for FreeBSD (#190596)
When the linker is specified as ld, toolchain applies special handling
by invoking (triple)-ld instead of resolving ld via standard PATH
lookup. This causes GNU ld installed via the system package manager to
take the precedence (since (triple)-ld appears earlier in the search
path), effectively overriding ld.lld.
As a result, we set the default Linker on FreeBSD to ld.lld to indicate
we want to use lld by default.
PR: 292067
MFC after: 3 days
(cherry picked from commit 2b619b7c7b5300cbaf59e4e9d75bc8472df014e9)
sockstat: consolidate unix(4) protocols in the array of protocols
This makes it possible to list unix(4) protocols in -P, which was not
possible before. Update the manual page and provide an example.
In 'struct sock' make member proto a pointer into the protocols table
instead of a number. This removes namespace collision that mixed
IPPROTO_TCP and etc with SOCK_STREAM and etc. There were no known bugs
due to this collision, though.
Preserve all current UI bugs for possible combinations of protocol
selection options. Should be no UI changes outside the improved -P.
Reviewed by: pouria, tuexen
Differential Revision: https://reviews.freebsd.org/D57508
sockstat: don't use getprotoent(3)
This removes requirement for existence of obsolete IPPROTO_DIVERT in
<netinet/in.h> and the 'divert' entry in /etc/protocols.
Also, this avoids running through the nsdispatch(3) machinery on startup,
cutting down about 20 syscalls, three of which are open(2). The code of
sockstat(1) itself is also reduced.
The only UI change for a normal execution is that now the divert(4)
sockets are reported as "divert4" instead of "div4". The prefix "4"
itself is also incorrect, as divert(4) is not a part of IPv4. This will
be addressed in a separate change.
There is small UI change for incorrect runs. Previously protocols listed
in /etc/protocols, but not supported, would err out like this:
# sockstat -P ggp
sockstat: protocol 3 not supported
[13 lines not shown]
Revert "rpc.tlsservd.c: Pin max threads at 1 for now"
This reverts commit 7a289fe3cd5c6de7ddbe394b7700b20b0bafdb3e.
Hopefully, commit fc7993cf2d6d has fixed the underlying
problem reported by PR#289734, so I am reverting this
temporary work-around.
I will delay MFC'ng this for a while, to see if the
problem occurs again.
MFC after: 3 months
netexport: Move struct netexport in a .h file and refcnt it
This patch moves "struct netexport" into a separate
netexport.h file and refcounts the structure, plus adds
a few fields that will be used in a future NFS server
commit.
The patch also includes some helper functions for
handling the netextport structure:
vfs_netexport_alloc(), vfs_netexport_acquire(),
vfs_netexport_release() and vfs_netexport_reset().
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D57553
Revert "kldload: Improve error handling"
It broke the test suite, and will be recommitted when fixed.
This reverts commit db887713de2bf5c77494220a9e0ddfa7d4290155.
Reported by: markj
wtap(4): implement monitor mode and handle radiotap
Implement monitor mode by simply adding IEEE80211_C_MONITOR to ic->ic_cap.
To get additional informations when capturing 802.11 frames, radiotap is
inserted by wtap_tx_tap() when TX and wtap_rx_tap() when RX.
There are some type faults in struct wtap_rx_radiotap_header which are
mainly mistakenly store unsigned values into signed integers.
I have fixed them (wtap(4)) by complying with the types defined
in https://www.radiotap.org/fields/defined.
Becuase the struct wtap_rx_radiotap_header comes from ath(4),
there may be another patch to fix the type faults in ath(4).
Differential Review: https://reviews.freebsd.org/D36469
wtap(4): Implement STA/HostAP mode and support WPA/WPA2
Below is the commit message:
```
Wtap originally only supported mesh/ad-hoc mode, and cannot be combined
with wpa_supplicant(8) and hostapd(8) since it's unaware of encryption/decryption.
This commit adds support for hostap and sta mode with WPA/WPA2, thus wtap(4)
can now be used with hostapd(8) and wpa_supplicant(8).
```
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36243
wtap: Remove bogus NULL check in wtap_transmit
The node pointer is guaranteed to be non-NULL by the net80211 stack.
The original check was also ineffective as it dereferenced ni->ni_vap before the NULL check.
Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D54547
devd/snd.conf: Handle absent control device properly
If virtual_oss is not enabled when these rules run on startup, dmesg
will show the following messages:
Starting devd.
virtual_oss_cmd: Could not open control device: /dev/vdsp.ctl: No such file or directory
virtual_oss_cmd: Could not open control device: /dev/vdsp.ctl: No such file or directory
Reported by: olce, Mark Millard <marklmi at yahoo.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
(cherry picked from commit 439b219fed3eea8ad3e1204393a8605826b8bbca)
uvideo: increase isochronous transfer depth for throughput
Increase NFRAMES_MAX from 40 to 128 and IXFERS from 3 to 5 to keep
more packets in flight on the USB bus. This brings throughput from
~13.5 MB/s to ~21 MB/s (for comparison on the same camera webcamd
provided ~20MB/s.
The linux driver also uses 5 IXFERS (but only 32 NFRAMES_MAX)
Tested by: manu
uvideo: add Camera Terminal controls
Implement UVC Camera Terminal (CT) controls per UVC 1.5 specification
Table A-12. This adds support for camera-specific controls that are
separate from the Processing Unit controls already supported.
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D56962
uvideo: add kqueue support
Add EVFILT_READ kqueue filter so applications using kqueue/kevent
can efficiently wait for video frames instead of polling.
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D56961
uvideo: import uvideo(4) driver from OpenBSD
Port the uvideo(4) driver from OpenBSD. This provides
native USB Video Class (UVC) support for webcams and video capture
devices.
The main changes are adaptation for:
- USB transfer callback model
- isoc data extraction via usbd_copy_out(),
- V4L2 struct alignment for ABI compatibility with v4l_compat.
Note that this implementation can coexist with webcamd.
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D56960
tools/test/stress2/misc/msdos12.sh: fix permission issue
This test runs with rights of an un-privileged user writing to a file
system only writable by the owner. Since no UID was provided in the
mount command, the owner of the file system was "root", and thus
writing was not allowed for $testuser. Fix this issue by mounting
with "-u $testuser".
MFC after: 3 days
(cherry picked from commit b440741db4ea1ccfa17acc2b3c37863dd819dcf3)
tools/test/stress2/misc/all.debug.inc: skip undefined variables
On my ZFS based systems, no allocations occur with tags "newblk" or
"freework". This leads to errors executing the tests that check for
memory leaks. Skip the checks if the output of wmstat -m does not
contain lines corresponding to those allocations.
MFC after: 3 days
(cherry picked from commit 6e5b990c509777544b790cc8e490965166d04684)
tools/test/stress2/misc: Add msdosfs tests for surrogate pairs
Test msdos22.sh creates 1000 files with long random names consisting
of only ASCII characters. The mount is performed without -L option,
therefore no use of iconv to convert between character sets.
Test msdos23.sh mixes some non-ASCII characters into the file names.
The file system is therefore mounted with -L C.UTF-8 to include tests
of the conversions between UTF-8 and UTF-16.
Test msdos24.sh adds emojis to the names to test the (not yet
committed) support of UTF-16 surrogate pairs in filenames.
(cherry picked from commit aa029088ec130d71b406c4118346fbd933940826)
(cherry picked from commit 11f23d7c078b319285727d277f05b6962280bcce)
(cherry picked from commit 596dadbbb5a711477f811fed65a6c463801d16c5)
(cherry picked from commit 3260c42c4183ac817cf08fcaa236d4d21b4fc0d2)
tools/test/stress2/misc/all.debug.inc: skip undefined variables
On my ZFS based systems, no allocations occur with tags "newblk" or
"freework". This leads to errors executing the tests that check for
memory leaks. Skip the checks if the output of wmstat -m does not
contain lines corresponding to those allocations.
MFC after: 3 days
(cherry picked from commit 6e5b990c509777544b790cc8e490965166d04684)
tools/test/stress2/misc/msdos12.sh: fix permission issue
This test runs with rights of an un-privileged user writing to a file
system only writable by the owner. Since no UID was provided in the
mount command, the owner of the file system was "root", and thus
writing was not allowed for $testuser. Fix this issue by mounting
with "-u $testuser".
MFC after: 3 days
(cherry picked from commit b440741db4ea1ccfa17acc2b3c37863dd819dcf3)
tools/test/stress2/misc: Add msdosfs tests (currently failing)
Test msdos22.sh creates 1000 files with long random names consisting
of only ASCII characters. The mount is performed without -L option,
therefore no use of iconv to convert between character sets.
Test msdos23.sh mixes some non-ASCII characters into the file names.
The file system is therefore mounted with -L C.UTF-8 to include tests
of the conversions between UTF-8 and UTF-16.
Test msdos24.sh adds emojis to the names to test the (not yet
committed) support of UTF-16 surrogate pairs in filenames.
(cherry picked from commit aa029088ec130d71b406c4118346fbd933940826)
(cherry picked from commit 11f23d7c078b319285727d277f05b6962280bcce)
(cherry picked from commit 596dadbbb5a711477f811fed65a6c463801d16c5)
(cherry picked from commit 3260c42c4183ac817cf08fcaa236d4d21b4fc0d2)
fs/msdosfs: add support for file namws with surrogate pairs
Long file names are using UTF-16 symbols to represent international or
special characters. The implementation in FreeBSD did not support the
"Supplementary Private Use Area-B" (PUA-B), which requires a surrogate
pair to be represented in UTF-16 (Unicode code points beyond U+FFFF).
The PUA-B is used to represent emoji characters, which are supported
in file names on other common operating systems. The motivation for
this change was that removable media written on another system were
only partially readable on FreeBSD, since they contained emojis in
file names.
A test script that verifies correct operations on files names with
emojis has been added to the tools/test/stress2/misc directory under
the name msdos24.sh.
Reported by: Fabian Keil <fk at fabiankeil.de>
Reviewed by: ib
[6 lines not shown]
fs/msdosfs: add support for file namws with surrogate pairs
Long file names are using UTF-16 symbols to represent international or
special characters. The implementation in FreeBSD did not support the
"Supplementary Private Use Area-B" (PUA-B), which requires a surrogate
pair to be represented in UTF-16 (Unicode code points beyond U+FFFF).
The PUA-B is used to represent emoji characters, which are supported
in file names on other common operating systems. The motivation for
this change was that removable media written on another system were
only partially readable on FreeBSD, since they contained emojis in
file names.
A test script that verifies correct operations on files names with
emojis has been added to the tools/test/stress2/misc directory under
the name msdos24.sh.
Reported by: Fabian Keil <fk at fabiankeil.de>
Reviewed by: ib
[6 lines not shown]