FreeBSD/src 748b510 — libexec/rc network.subr, libexec/rc/rc.d rtsold netif

IPv6: rc boot time improvements

If IPv6 is enabled we call rtsol on that interface so waiting in
rtsold is counterproductive; if one was to just use rtsold -F then
they are on their own for having the addresses usable during the
remaining startup time.

Rather than sleeping dad_count + 1 seconds we are now checking for
any tentative addresses on the interface and only then sleep
dad_count up-to 2 times.  This should save us at least a dad_count
with the seconds with Optimistic DAD enabled (default) but there
are too many assumptions invovled anyway.
(RETRANS_TIMER in the kernel being 1000ms being one).

The reason why we need to sleep more than dad_count (1s default)
seems to be that first DAD for the link-local address clears and
only then solicited (or other global) addresses are handled.

Co-authored-by: Pouria Mousavizadeh Tehrani <pouria at FreeBSD.org>

    [3 lines not shown]
DeltaFile
+46-0libexec/rc/network.subr
+6-4libexec/rc/rc.d/netif
+0-7libexec/rc/rc.d/rtsold
+52-113 files

FreeBSD/src da0d8fe — sys/amd64/vmm/intel vmx.c

amd64/vmm: Do not fall back to the VMCS for vmxctx registers

vmx_setreg() first calls vmxctx_setreg() and, if that fails, handles the
register as a VMCS field.  This relies on vmxctx_setreg() failing only
for registers that are not kept in the vCPU context.  Were it to reject
a value for one of its own registers, the error would be dropped and
the request passed on to vmcs_setreg(), which would fail it only
because the register has no VMCS field.

Check whether the register is kept in the vCPU context instead, and if
so return the result of vmxctx_setreg() directly.  This lets
vmxctx_setreg() validate values and have its error returned as is.  Do
the same in vmx_getreg(), so that the two functions read alike.

No functional change intended.

Reviewed by:    markj
Approved by:    markj
Sponsored by:   Alchemilla Ventures Private Limited
Differential Revision:  https://reviews.freebsd.org/D61954
DeltaFile
+4-4sys/amd64/vmm/intel/vmx.c
+4-41 files

FreeBSD/src 3a5512d — sys/amd64/vmm/intel vmx.c

amd64/vmm: Restore vmxctx registers through vmxctx_setreg()

vmx_vcpu_snapshot() copies the guest registers kept in the vCPU context
straight between the context and the snapshot buffer, while
VM_SET_REGISTER stores them through vmxctx_setreg().  A check added to
vmxctx_setreg() would thus not apply to values restored from a
snapshot.

Add vmxctx_snapshot_reg(), modelled on vmcs_snapshot_reg(), and use it
for every register in the vCPU context, so that both paths store values
the same way.  The snapshot format does not change.

No functional change intended.

Reviewed by:    markj
Approved by:    markj
Sponsored by:   Alchemilla Ventures Private Limited
Differential Revision:  https://reviews.freebsd.org/D61953
DeltaFile
+45-25sys/amd64/vmm/intel/vmx.c
+45-251 files

FreeBSD/src 586e826 — sys/amd64/vmm/intel vmx.c

amd64/vmm: Reject reserved DR6 bits supplied by userspace

On Intel hosts the guest's DR6 is kept in the vCPU context and loaded
into the host's register before guest entry.  VM_SET_REGISTER and the
snapshot restore path store any value there.  Loading a value with any
of bits 63:32 set raises #GP, which panics the host.

Fail with EINVAL instead.

Reviewed by:    markj
Approved by:    markj
Fixes:          65eefbe42218 (Save and restore guest debug registers.)
MFC after:      1 week
Sponsored by:   Alchemilla Ventures Private Limited
Differential Revision:  https://reviews.freebsd.org/D61732
DeltaFile
+11-1sys/amd64/vmm/intel/vmx.c
+11-11 files

FreeBSD/src f9da547 — lib/libvmmapi vmmapi.h vmmapi.c

libvmmapi: Compare mapping lengths in vm_mmap_memseg()

vm_mmap_memseg() returns success without mapping anything when a
mapping with the same segment, offset, protection and flags already
starts at the requested address, but it does not compare the length.
A longer request then reports success for pages it did not map, and a
shorter one for a mapping that vm_munmap_memseg() cannot remove with
the same range.  No caller in the tree makes such a request.

Fail with EEXIST when the length differs, as for the other attributes,
and document that behavior.  Read the existing mapping into its own
structure rather than over the arguments.

Reviewed by:    markj
Approved by:    markj
Fixes:          9b1aa8d622e8 (Restructure memory allocation in bhyve to support "devmem".)
Sponsored by:   Alchemilla Ventures Private Limited
Differential Revision:  https://reviews.freebsd.org/D61530
DeltaFile
+10-6lib/libvmmapi/vmmapi.c
+3-1lib/libvmmapi/vmmapi.h
+13-72 files

FreeBSD/src 50a3713 — usr.sbin/bhyve/amd64 inout.c

bhyve: Preserve string I/O registers on faults before progress

When a string I/O instruction faults on its first transfer, the emulator
injects the exception but still writes the masked index and count back
to the guest.  With a 32-bit address size in 64-bit mode this clears
the upper halves of RSI or RDI and of RCX, although no transfer
completed and the processor reports such a fault with the registers
unchanged.

Return before updating the registers whenever no transfer completed,
whether an error, a guest fault or an injected exception stopped the
first one.  Exception injection has already restarted the instruction.
A repeated instruction with a zero count is handled as before.

Reviewed by:    markj
Approved by:    markj
Sponsored by:   Alchemilla Ventures Private Limited
Differential Revision:  https://reviews.freebsd.org/D61499
DeltaFile
+9-0usr.sbin/bhyve/amd64/inout.c
+9-01 files

FreeBSD/src dbb4487 — sys/amd64/vmm vmm_ioport.c, usr.sbin/bhyve/amd64 inout.c

bhyve: Preserve upper RAX bits for byte and word input

Scalar IN merges the input into a 32-bit EAX temporary and writes that
value to RAX.  This clears bits 63:32 for byte and word inputs, which
must preserve the bits outside AL or AX.

Use vie_update_register() to update the accumulator at the operand
width.  This preserves the remaining bits for byte and word inputs and
retains zero-extension for dword inputs.

Reviewed by:    markj
Approved by:    markj
Sponsored by:   Alchemilla Ventures Private Limited
Differential Revision:  https://reviews.freebsd.org/D61498
DeltaFile
+2-4usr.sbin/bhyve/amd64/inout.c
+2-4sys/amd64/vmm/vmm_ioport.c
+4-82 files

FreeBSD/src f18c1ca — sys/net/route fib_algo.c

route/fib_algo: Fix nexthop reference leak on FLM_BATCH

handle_rtable_change_cb() references the new nexthop before calling
the algorithm.  If the algorithm asks to batch the change by
returning FLM_BATCH, queue_rtable_change() references the same
nexthop again for the queued entry, while apply_rtable_changes()
only unreferences the old nexthop of each entry.

Reference new nhop once in handle_rtable_change_cb(), before
deciding whether the change is queued or passed to the algorithm,
and do not reference it again in fill_change_entry().  This also
leaves the queue reallocation as the only way for
queue_rtable_change() to fail.

Currently, dxr is the only algorithm returning FLM_BATCH.

Fixes:          6b8ef0d428c9 ("Add batched update support for the fib algo.")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D61577

    [2 lines not shown]
DeltaFile
+21-21sys/net/route/fib_algo.c
+21-211 files

FreeBSD/src 7982875 — sys/net/route nhgrp_ctl.c, sys/netlink/route nexthop.c

rtnetlink: Use default weight for unset weights in NHA_GROUP

newnhg() copied the weights of a nhgrp as is and a group
whose members all have a zero weight, which is what
userland sends when it leaves the weight unset, made
calc_min_mpath_slots_fast() divide by zero.

Therefore replace weight of zero with RT_DEFAULT_WEIGHT.

While here, return early from calc_min_mpath_slots_fast()
if all weights are zero.

MFC after:      3 days
Fixes:          7e5bf68495cc ("netlink: add netlink support")

(cherry picked from commit 1db6e2c6c3554efe5acdcc20bc7aa889e1efe372)
DeltaFile
+1-1sys/netlink/route/nexthop.c
+1-1sys/net/route/nhgrp_ctl.c
+2-22 files

FreeBSD/src 1d3b5b2 — sys/net/route fib_algo.c

route/fib_algo: Fix nexthop reference leak on FLM_BATCH

handle_rtable_change_cb() references the new nexthop before calling
the algorithm.  If the algorithm asks to batch the change by
returning FLM_BATCH, queue_rtable_change() references the same
nexthop again for the queued entry, while apply_rtable_changes()
only unreferences the old nexthop of each entry.

Reference new nhop once in handle_rtable_change_cb(), before
deciding whether the change is queued or passed to the algorithm,
and do not reference it again in fill_change_entry().  This also
leaves the queue reallocation as the only way for
queue_rtable_change() to fail.

Currently, dxr is the only algorithm returning FLM_BATCH.

Fixes:          6b8ef0d428c9 ("Add batched update support for the fib algo.")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D61577

    [2 lines not shown]
DeltaFile
+23-23sys/net/route/fib_algo.c
+23-231 files

FreeBSD/src 3e6cc85 — sys/net/route nhgrp_ctl.c, sys/netlink/route nexthop.c

rtnetlink: Use default weight for unset weights in NHA_GROUP

newnhg() copied the weights of a nhgrp as is and a group
whose members all have a zero weight, which is what
userland sends when it leaves the weight unset, made
calc_min_mpath_slots_fast() divide by zero.

Therefore replace weight of zero with RT_DEFAULT_WEIGHT.

While here, return early from calc_min_mpath_slots_fast()
if all weights are zero.

MFC after:      3 days
Fixes:          7e5bf68495cc ("netlink: add netlink support")

(cherry picked from commit 1db6e2c6c3554efe5acdcc20bc7aa889e1efe372)
DeltaFile
+1-1sys/netlink/route/nexthop.c
+1-1sys/net/route/nhgrp_ctl.c
+2-22 files

FreeBSD/src 9798193 — sys/net/route route_ctl.c

routing: Fix nhop double free in rib_copy_route()

add_route_flags() consumes the nexthop reference on every
failure path, so nhop_free() in rib_copy_route() releases it for
the second time.

This is reachable when growing net.fibs while two existing fibs
hold the same pinned prefix.

MFC after:      3 days
Fixes:  40503b792f7e ("routing: populate fibs with interface...")

(cherry picked from commit efa14ab698fe5c3a1586aec006f98e3781f4af78)
DeltaFile
+0-1sys/net/route/route_ctl.c
+0-11 files

FreeBSD/src a972d26 — sys/arm/broadcom/bcm2835 bcm2835_mbox.c bcm2835_mbox_prop.h

bcm2835_fbd: Use the pixel order to choose the 32 bpp palette

Recent Raspberry Pi firmware acts on the pixel order requested through
the mailbox, which older firmware ignored.  The order that ends up in
the framebuffer is the requested one combined with framebuffer_swap in
config.txt: when they are the same the red component is in bits 0-7 of
a 32 bpp pixel, when they differ it is in bits 16-23.  framebuffer_swap
defaults to on and the firmware reports it as bcm2708_fb.fbswap=1 in
the bootargs.

U-Boot always requests RGB, so with the default config.txt the pixels
have red in bits 0-7.  The driver however always configured vt(4) with
red in bits 16-23 for 32 bpp, so red and blue were swapped on the
console.

The firmware does not report the resulting order, only the requested
one, so read the pixel order with GET_PIXEL_ORDER and combine it with
fbswap.  If the pixel order cannot be read the previous behavior is
kept.  The 24 bpp case is unchanged.

    [6 lines not shown]
DeltaFile
+33-11sys/arm/broadcom/bcm2835/bcm2835_fbd.c
+30-0sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h
+20-0sys/arm/broadcom/bcm2835/bcm2835_mbox.c
+83-113 files

FreeBSD/src 05f2f41 — sys/arm64/arm64 trap.c pmap.c

arm64: Reject user-mode faults on kernel addresses

On a CPU without FEAT_E0PD, a user-mode store to a mapped kernel
address takes a permission fault, which data_abort() passes to
pmap_fault() with the process's pmap.  pmap_pte() then finds the user
mapping whose address has the same low-order bits.  If that mapping is
writable, pmap_fault() marks it dirty, although nothing wrote it, and
returns KERN_SUCCESS.  The store is retried and faults again, so the
thread spins instead of receiving SIGSEGV.  Access flag faults, which
loads also take, have the same flaw when a kernel mapping lacks
ATTR_AF.

Like amd64's trap_pfault(), send SIGSEGV for a user-mode fault in the
kernel address space without calling pmap_fault() or vm_fault_trap().

Also, in pmap_fault(), assert that a kernel address comes with the
kernel pmap and a user address with a user pmap.

Found by:       Claude Code (Opus 5.5)

    [3 lines not shown]
DeltaFile
+10-0sys/arm64/arm64/pmap.c
+8-0sys/arm64/arm64/trap.c
+18-02 files

FreeBSD/src f7c709b — contrib/lutok/api-docs/html menu.js a00919.html, contrib/lutok/api-docs/html/search search.js

contrib/lutok: upgrade to 0.7.0

This is a large cleanup release which has a number of changes that
should be largely transparent to end-users of lutok.

Please see NEWS for more details, as well as the vendor import commit.

MFC after:      1 week
Merge commit 'a1e3c85b0684e1a1896fbf811a894a45e658ec83'
DeltaFile
+1,200-600contrib/lutok/api-docs/html/doxygen.css
+1,583-91contrib/lutok/api-docs/html/a00923.html
+103-1,566contrib/lutok/api-docs/html/a00919.html
+0-1,070contrib/lutok/m4/ac_cxx_compile_stdcxx.m4
+473-543contrib/lutok/api-docs/html/search/search.js
+535-82contrib/lutok/api-docs/html/menu.js
+3,894-3,952187 files not shown
+9,755-11,060193 files

FreeBSD/src a1e3c85 — . configure, api-docs/html a00919.html a00923.html

lutok: import lutok-0.7.0

This change adds lutok lutok-0.7.0 from [upstream][1].

The lutok-0.7.0 artifact was been verified by [SHA256 checksum][3].

This is a major cleanup release. A lot of credit goes to mchoo@ for all of the
hard work submitted in #13 🎉.

The API should not change in a noticeable way to consumers, e.g., a number of
"transparent" changes like const poisoning was done with methods, etc.
Iterative builds will require rebuilding lutok from scratch--which should
happen naturally, given how header dependencies [should] be treated with make.

More information about the release (from a high level) can be found in
the [release notes][4].

Updated via [`update_lutok.sh`][4] like: `update_lutok.sh 0.7.0 lutok-0.7.0`.


    [4 lines not shown]
DeltaFile
+4,733-2,987configure
+1,200-600api-docs/html/doxygen.css
+1,583-91api-docs/html/a00923.html
+103-1,566api-docs/html/a00919.html
+473-543api-docs/html/search/search.js
+601-159m4/libtool.m4
+8,693-5,946188 files not shown
+15,887-12,116194 files

FreeBSD/src e2cdda4 — sys/dev/rtwn if_rtwnvar.h if_rtwn.c, sys/dev/rtwn/pci rtwn_pci_attach.c

rtwn: move rtwn_get_qmap + write register to rtwn_set_qmap

Upcoming chipset support changes the definition of the register.
So instead of having the abstraction be "return the qmap to write
to the register", change it to "set the qmap however the chipset
wants it to be."

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61928
Tested on: RTL8821AU (adrian)
DeltaFile
+18-0sys/dev/rtwn/rtl8192c/usb/r92cu_init.c
+0-15sys/dev/rtwn/usb/rtwn_usb_ep.c
+0-12sys/dev/rtwn/pci/rtwn_pci_attach.c
+10-0sys/dev/rtwn/rtl8192c/pci/r92ce_init.c
+3-4sys/dev/rtwn/if_rtwn.c
+3-3sys/dev/rtwn/if_rtwnvar.h
+34-3413 files not shown
+46-3619 files

FreeBSD/src 948598a — usr.sbin/syslogd syslogd.c, usr.sbin/syslogd/tests syslogd_test.sh

syslogd: Create one forwarding socket per address pair

For each address a forwarding destination resolves to,
make_forw_socket_array() creates a socket bound to the address of each
listening socket and connects it to the destination.  The same
<laddr, raddr> pair can come up more than once for one rule: the
resolver may return an address twice, e.g. when a host name appears on
several /etc/hosts lines for one IP, and several listening sockets may
be bound to one address.  connect() then fails with EADDRINUSE.
maybe_dup_forw_socket() only searches the rules parsed earlier, so the
casper process exits and syslogd dies with "Failed to xfer
configuration nvlist" on every start and reload.

Skip address pairs the rule already has a socket for.  A second socket
would add nothing, and with -A it would send each message twice.

Reported by:            Marcos Mendoza
Reviewed by:            markj
Fixes:                  ae4f708f0b38 ("syslogd: Ensure that forwarded...")

    [4 lines not shown]
DeltaFile
+60-0usr.sbin/syslogd/tests/syslogd_test.sh
+38-17usr.sbin/syslogd/syslogd.c
+98-172 files

FreeBSD/src c362b2f — sys/conf newvers.sh

14.5: Update to RC1

Approved by:    re (implicit)
DeltaFile
+1-1sys/conf/newvers.sh
+1-11 files

FreeBSD/src 86f4630 — contrib/tzcode localtime.c

tzcode: Avoid integer truncation resulting in wrong weekday

From a report[1] on the tz mailing list:

In timesub() the weekday is stored in (int) tm_wday before reduction
modulo seven (DAYSPERWEEK).  Previously this could overflow a 32-bit
int, resulting in an incorrect weekday calculation.

Calculate two additional intermediate terms modulo seven to avoid an
intermediate value that does not fit in 32 bits.

We're committing this patch now so we can have something in place for
FreeBSD 15.2.  If a different change is committed upstream we will
replace this.

[1] https://lists.iana.org/hyperkitty/list/tz@iana.org/thread/O3RZGBKSO5GXBFDZKW2JXO3OQIIGYBF3/

Approved by:    re (cperciva)
PR:             300977

    [6 lines not shown]
DeltaFile
+2-2contrib/tzcode/localtime.c
+2-21 files

FreeBSD/src 850a74b — release/pkg_repos release-dvd.conf

Switch from "quarterly" to "release" pkgs on DVD

Approved by:    re (implicit)
DeltaFile
+1-1release/pkg_repos/release-dvd.conf
+1-11 files

FreeBSD/src d05d660 — sys/netinet tcp_subr.c

tcp: count only the SACK blocks that fit in tcp_maxseg()

tcp_addoptions() sends only the SACK blocks that fit in TCP_MAXOLEN.
tcp_maxseg() counted every pending block and clamped the total, so
without timestamps and with five or more blocks pending it came out 4
bytes below the segment tcp_output() sends.  Limited transmit after an
RTO then sent one full segment and failed the "sent too much" KASSERT.

Approved by:    re (cperciva)
PR:             282605
Approved by:    adrian (mentor)
Signed-off-by:  Nick Price <nprice at FreeBSD.org>
Reviewed by:    tuexen, glebius, adrian
Differential Revision:  https://reviews.freebsd.org/D60460
(cherry picked from commit d3b02115d4b373c719d9a716da38d94511de3f07)
(cherry picked from commit aacae7b35a22a56e187a0a41db231d63ca9cefb6)
DeltaFile
+6-3sys/netinet/tcp_subr.c
+6-31 files

FreeBSD/src 8d4a8d1 — sys/netinet tcp_input.c, sys/netinet/tcp_stacks bbr.c rack.c

tcp: improve ISS checking for ghost ACKs

The check in tcp_adapt_iss_check() depends on SND.UNA and therefore
should be performed whenever SND.UNA is incremented.

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

(cherry picked from commit 9e345ca583f702e7472f836136e766d3346c049d)
(cherry picked from commit ce78b5a3d47574fafbe86d1ce9dcef7c19360e95)
DeltaFile
+4-1sys/netinet/tcp_stacks/rack.c
+2-1sys/netinet/tcp_stacks/bbr.c
+2-1sys/netinet/tcp_input.c
+8-33 files

FreeBSD/src c52b45e — sys/netinet tcp_input.c tcp_var.h, sys/netinet/tcp_stacks rack.c bbr.c

tcp: improve consistency

Use an inline function tcp_adapt_iss_check() to perform the check
consistently instead of replicating the code multiple times. These
checks already became inconsistent.
A fix for PR 298560 requires more calls to tcp_adapt_iss_check().

Approved by:    re (cperciva)
Reviewed by:            Peter Lei
Fixes:                  fa2ad70a4511 ("tcp: make ghost ACK handling more conformant")
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61685

(cherry picked from commit e3483dbc91b59b5b2c73a4bc792fbb834c3dc111)
(cherry picked from commit 73929d1dc3b4116ca12cc3fe08fa3a9b66bf3318)
DeltaFile
+10-0sys/netinet/tcp_var.h
+1-4sys/netinet/tcp_stacks/rack.c
+1-4sys/netinet/tcp_stacks/bbr.c
+1-4sys/netinet/tcp_input.c
+13-124 files

FreeBSD/src 202f628 — sys/netinet tcp_input.c

tcp: make ghost ACK handling more conformant

The latest version of draft-ietf-tcpm-tcp-ghost-acks changed
a condition. This should make no substantial difference, but makei
it compliant to the latest version of the specification.

Approved by:    re (cperciva)
Reviewed by:            rscheff, Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D58411

(cherry picked from commit fa2ad70a4511e7b379e81de82c9e51b2e0994295)
(cherry picked from commit a170546cb8d13a67ee3062114228d3df4744bbee)
DeltaFile
+1-1sys/netinet/tcp_input.c
+1-11 files

FreeBSD/src 6a3f0ed — sys/netinet tcp_output.c

tcp: improve sender side SWS avoidance

When checking for a full sized segment, take all TCP options that will
be included into account. This fixes a bug which can trigger the
"sent too much" KASSERT related to limited transmit.

Approved by:    re (cperciva)
Reported by:            olivier
Reviewed by:            rscheff, Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61605

(cherry picked from commit d174085f9f895ed444bd95120da3eff481a58f1a)
(cherry picked from commit 13357c1ee34f9f8655375714c60da8bf4881493a)
DeltaFile
+1-13sys/netinet/tcp_output.c
+1-131 files

FreeBSD/src 480ff19 — sys/netinet/tcp_stacks bbr.c

tcp bbr: improve handling of retransmissions in LAST-ACK

When performing a timer based retransmission, clear the
BBR_RWND_COLLAPSED flag. If it sticks, t_rxtshift is never incremented
resulting in unlimited retransmissions in the LAST-ACK state.

Approved by:    re (cperciva)
Reported by:            Illia Vynohradov
Reviewed by:            Peter Lei
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D61586

(cherry picked from commit 3c6fd437b1824caeddb5f0d4570d43cf0c999c14)
(cherry picked from commit cbd17b66e64e9bdf025200c4993b8aeae6a0ebe9)
DeltaFile
+1-1sys/netinet/tcp_stacks/bbr.c
+1-11 files

FreeBSD/src 1b9c494 — sys/netinet/tcp_stacks bbr.c

tcp bbr: improve persits timeout computation

t_srtt and t_rttvar use different lengths of fractions, therefore use
the appropriate shift value.

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

(cherry picked from commit 751882926dc0bb1f7a4834c4b5e8d951cee61c7c)
(cherry picked from commit 3e74519d5136d4eb0fee56148ff30c66607a3eac)
DeltaFile
+1-1sys/netinet/tcp_stacks/bbr.c
+1-11 files

FreeBSD/src 1180c43 — sys/netinet/tcp_stacks bbr.c

tcp bbr: improve retransmit timout calculation

The retransmission timeout should the srtt + 4 * rttvar.
The srtt is using 5 bits of fractions and rttvar is using 4 bits of
fractions, some specific shifting is required.

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

(cherry picked from commit 2f98793a13fe3e69cf6b698fa469550b4ba0fea1)
(cherry picked from commit ccf8e3762c3948446263ae3ef0dd98391ef9f97e)
DeltaFile
+1-2sys/netinet/tcp_stacks/bbr.c
+1-21 files

FreeBSD/src da83cb9 — contrib/tzcode localtime.c

tzcode: Avoid integer truncation resulting in wrong weekday

From a report[1] on the tz mailing list:

In timesub() the weekday is stored in (int) tm_wday before reduction
modulo seven (DAYSPERWEEK).  Previously this could overflow a 32-bit
int, resulting in an incorrect weekday calculation.

Calculate two additional intermediate terms modulo seven to avoid an
intermediate value that does not fit in 32 bits.

We're committing this patch now so we can have something in place for
FreeBSD 15.2.  If a different change is committed upstream we will
replace this.

[1] https://lists.iana.org/hyperkitty/list/tz@iana.org/thread/O3RZGBKSO5GXBFDZKW2JXO3OQIIGYBF3/

PR:             300977
Requested by:   re (cperciva)

    [4 lines not shown]
DeltaFile
+2-2contrib/tzcode/localtime.c
+2-21 files