OPNSense/src 714aab4sys/netinet ip_fastfwd.c, sys/netinet6 ip6_fastfwd.c ip6_forward.c

netinet(6): shared forwarding requires different pointers

PR: https://github.com/opnsense/src/issues/259
Fixes: 2927ebde3001
DeltaFile
+2-2sys/netinet/ip_fastfwd.c
+2-2sys/netinet6/ip6_fastfwd.c
+2-2sys/netinet6/ip6_forward.c
+6-63 files

OPNSense/src 64f4e2bsys/arm/nvidia/drm2 tegra_bo.c, sys/compat/linuxkpi/common/src linux_page.c

Avoid waiting on physical allocations that can't possibly be satisfied

- Change vm_page_reclaim_contig[_domain] to return an errno instead
  of a boolean.  0 indicates a successful reclaim, ENOMEM indicates
  lack of available memory to reclaim, with any other error (currently
  only ERANGE) indicating that reclamation is impossible for the
  specified address range.  Change all callers to only follow
  up with vm_page_wait* in the ENOMEM case.

- Introduce vm_domainset_iter_ignore(), which marks the specified
  domain as unavailable for further use by the iterator.  Use this
  function to ignore domains that can't possibly satisfy a physical
  allocation request.  Since WAITOK allocations run the iterators
  repeatedly, this avoids the possibility of infinitely spinning
  in domain iteration if no available domain can satisfy the
  allocation request.

PR:             274252
Reported by:    kevans

    [13 lines not shown]
DeltaFile
+44-14sys/vm/vm_page.c
+27-5sys/vm/vm_domainset.c
+22-2sys/vm/vm_kern.c
+6-3sys/arm/nvidia/drm2/tegra_bo.c
+6-3sys/dev/drm2/ttm/ttm_page_alloc.c
+5-3sys/compat/linuxkpi/common/src/linux_page.c
+110-305 files not shown
+123-3911 files

OPNSense/src 839d02csbin/ifconfig ifconfig.c

ifconfig: Display the IFCAP_HWSTATS capability without netlink

This follows the commit 4cdc1f5421c5, which introduces the IFCAP_HWSTATS
capability.

Fixes:  4cdc1f5421c5 There are some high performance NICs that count statistics in hardware
MFC after:      3 days

(cherry picked from commit 595acb29a35f36a4fc08b89d3a476f16c1d108b4)
(cherry picked from commit 6bcce275a5a9e10f8e5b990f8cfa2166aa49875a)
DeltaFile
+1-0sbin/ifconfig/ifconfig.c
+1-01 files

OPNSense/src c116bd7sbin/ifconfig af_inet6.c

ifconfig: also fix removing IPv6 addresses without netlink

Reported by:    bdrewery
MFC after:      1 week
See also:       da50f49977cc4e6aae55cb2379313599249a8dd2
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit c8fb5a4d032b28dd97b9fa4a73f85a84d8d35fdd)
DeltaFile
+1-1sbin/ifconfig/af_inet6.c
+1-11 files

OPNSense/src 9a29980sbin/ifconfig ifconfig.c

ifconfig: Fix the display of the IFCAP_MEXTPG capability without netlink

Historically this capability is IFCAP_NOMAP but it was renamed to
IFCAP_MEXTPG. Catch up with the change 3f43ada98c89.

PR:             289545
Fixes:          3f43ada98c89 Catch up with 6edfd179c86: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG
MFC after:      3 days

(cherry picked from commit 5017fdb728811fd3e15d7151524378f49a49aee1)
(cherry picked from commit 5f472754ba6f9cc95607956c6e2ad6483c9dd157)
DeltaFile
+1-1sbin/ifconfig/ifconfig.c
+1-11 files

OPNSense/src 171adf2sbin/ifconfig ifconfig_netlink.c ifconfig.c

Move print_bits to ifconfig.c and make available to other src files.

Reviewed by:    emaste
Event:          Kitchener-Waterloo Hackathon 202406
Differential Revision:  https://reviews.freebsd.org/D45441

(cherry picked from commit c3e9423743d91ae5b5865602a905900a1855055e)
DeltaFile
+0-23sbin/ifconfig/ifconfig_netlink.c
+23-0sbin/ifconfig/ifconfig.c
+2-0sbin/ifconfig/ifconfig.h
+25-233 files

OPNSense/src e19c438sbin/ifconfig ifconfig.8 ifconfig.c

ifconfig: Enter jail as soon as possible

Some options (in particular, -g) are processed immediately upon being
parsed.  This will produce the wrong result in combination with -j since
we only attach to the jail after we're done parsing arguments.  Solve
this by attaching to the jail immediately when -j is encountered.  The
downside is that e.g. `ifconfig -j foo -j bar` would previously attach
to jail “bar”, whereas now it will attempt to attach to jail “foo”, and
if successful, attempt to attach to jail “bar” within jail “foo”.  This
may be considered a feature.

PR:             289134
MFC after:      1 week
Reviewed by:    zlei
Differential Revision:  https://reviews.freebsd.org/D52501

(cherry picked from commit 18fd1443d205aed6be22966125a4820f77571948)
DeltaFile
+20-20sbin/ifconfig/ifconfig.8
+8-14sbin/ifconfig/ifconfig.c
+0-1sbin/ifconfig/ifconfig.h
+28-353 files

OPNSense/src f54f3b0sbin/ifconfig ifconfig.c af_nd6.c

Migrate from printb to print_bits for locally defined bit fields.

Reviewed by:    emaste
Event:          Kitchener-Waterloo Hackathon 202406
Differential Revision:  https://reviews.freebsd.org/D45441

(cherry picked from commit a68e4f7a065218f0bcc5b34ff8d2e73a240b59b2)
DeltaFile
+59-14sbin/ifconfig/ifconfig.c
+18-11sbin/ifconfig/af_nd6.c
+7-2sbin/ifconfig/ifgre.c
+5-2sbin/ifconfig/ifgif.c
+89-294 files

OPNSense/src 3523646sys/netpfil/ipfw ip_fw_nat.c

ipfw: Check for errors from sooptcopyin() and sooptcopyout()

Note, it looks like this code may be unused since commit 4a77657cbc01
("ipfw: migrate ipfw to 32-bit size rule numbers").  In particular, it
looks like the ipfw_nat_*_ptr pointers are unused now.

Reviewed by:    ae
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53068

(cherry picked from commit 2df39ce5d4a8836ef5fd3c2666f48041042eff42)
DeltaFile
+7-5sys/netpfil/ipfw/ip_fw_nat.c
+7-51 files

OPNSense/src 9776934usr.sbin/bsdinstall/scripts auto bootconfig

bsdinstall: Fix typos

Reviewed by:    emaste
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D53170

(cherry picked from commit 4ee348e27143b857445fd261cbe6695d6d57c836)
DeltaFile
+1-1usr.sbin/bsdinstall/scripts/auto
+1-1usr.sbin/bsdinstall/scripts/bootconfig
+1-1usr.sbin/bsdinstall/scripts/jail
+1-1usr.sbin/bsdinstall/scripts/keymap
+1-1usr.sbin/bsdinstall/scripts/script
+1-1usr.sbin/bsdinstall/scripts/zfsboot
+6-66 files

OPNSense/src 878daffsbin/dhclient packet.c

dhclient: improve UDP checksum handling

When sending UDP packets:
* compute the checksum in the correct order. This only has an impact
  if the length of the payload is odd.
* don't send packet with a checksum of zero, use 0xffff instead as
  required.
When receiving UDP packets:
* don't do any computations when the checksum is zero.
* compute the checksum in the correct order. This only has an impact
  if the length of the payload is odd.
* when computing the checksum, store the pseudo header checksum
* if the checksum is computed as zero, use 0xffff instead.
* also accept packets, when the checksum in the packet is the pseudo
  header checksum.
The last point fixes a problem when the DHCP client runs in a VM,
the DHCP server runs on the host serving the VM and the network
interface supports transmit checksum offloading. Since dhclient
doesn't use UDP sockets but bpf devices to read the packets, the

    [9 lines not shown]
DeltaFile
+35-18sbin/dhclient/packet.c
+35-181 files

OPNSense/src 2927ebdshare/man/man9 mbuf.9, sys/netinet ip_fastfwd.c tcp_input.c

sctp, tcp, udp: improve deferred computation of checksums

When the SCTP, TCP, or UDP implementation send a packet, it does not
compute the corresponding checksum but defers that. The network layer
will determine whether the network interface selected for the packet
has the requested capability and computes the checksum in software,
if the selected network interface doesn't have the requested
capability.
Do this not only for packets being sent by the local SCTP, TCP,
and UDP stack, but also when forwarding packets. Furthermore, when
such packets are delivered to a local SCTP, TCP, or UDP stack, do not
compute or validate the checksum, since such packets never have been on
the wire.
This allows to support checksum offloading also in the case of local
virtual machines or jails.
Support for epair, vtnet, and tap interfaces will be added in
separate commits.

Reviewed by:            kp, rgrimes, tuexen, manpages

    [3 lines not shown]
DeltaFile
+23-9share/man/man9/mbuf.9
+28-0sys/netinet6/ip6_fastfwd.c
+27-0sys/netinet6/ip6_forward.c
+22-0sys/netinet/ip_fastfwd.c
+8-9sys/sys/mbuf.h
+12-0sys/netinet/tcp_input.c
+120-184 files not shown
+142-2010 files

OPNSense/src 2f2e836share/man/man9 mbuf.9

mbuf.9: describe checksum offloading for SCTP

This describes the current status of the implementation.
While there, be a bit more precise on how long the checksum
computation is delayed.

Reviewed by:            Timo Völker, bcr
Differential Revision:  https://reviews.freebsd.org/D51590

(cherry picked from commit fe35f275ab0240cb5ed05484c943293a71aadb5f)
DeltaFile
+23-11share/man/man9/mbuf.9
+23-111 files

OPNSense/src 7e5d2c4. UPDATING, sys/conf newvers.sh

Add UPDATING entries and bump version

Approved by:    so
DeltaFile
+5-0UPDATING
+1-1sys/conf/newvers.sh
+6-12 files

OPNSense/src 063c85atests/sys/netinet so_reuseport_lb_test.c

so_reuseport_lb_test: Add a test case for connected UDP sockets

Approved by:    so

(cherry picked from commit 1dd66c6ac2c146f540b2ff825fbee442354aeee5)
(cherry picked from commit 7272e2d029c20c3144d7aa49500dc86d70344030)
DeltaFile
+148-0tests/sys/netinet/so_reuseport_lb_test.c
+148-01 files

OPNSense/src 33076c1sys/netinet in_pcb.c

inpcb: Ignore SO_REUSEPORT_LB on connected sockets

While TCP disallows connect()ing a socket with SO_REUSEPORT_LB, UDP does
not.  As a result, a connected UDP socket can be placed in the lbgroup
hash and thus receive datagrams from sources other than the connected
host.

Reported by:    Amit Klein <amit.klein at mail.huji.ac.il>
Reported by:    Omer Ben Simhon <omer.bensimhon at mail.huji.ac.il>
Reviewed by:    glebius
Approved by:    so
Security:       FreeBSD-SA-25:09.netinet
Security:       CVE-2025-24934

(cherry picked from commit 320ad3dec5ff1b37f6907a47961c18b9d77e6a53)
(cherry picked from commit e276759b368701a49e543c45d5d6ea08ed4fbc38)
DeltaFile
+10-3sys/netinet/in_pcb.c
+10-31 files

OPNSense/src bf2ff4esys/dev/virtio/network if_vtnet.c

vtnet: Do not compare boolean with integer

The type of variable promisc and allmulti was changed from int to bool
by commit [1].

[1] 7dce56596f36 Convert to if_foreach_llmaddr() KPI

MFC after:      3 days

(cherry picked from commit 80dfed11fc1c61ce9168db01dee263447619e859)
DeltaFile
+2-2sys/dev/virtio/network/if_vtnet.c
+2-21 files

OPNSense/src f0d7e7dsys/dev/virtio/network if_vtnet.c

vtnet: improve control of transmit offloading

Keep the hwassist flags for transmit checksum offload and transmit
segment offload in sync with the enabled capabilities.

Reported by:            Timo Völker
Reviewed by:            Timo Völker
Differential Revision:  https://reviews.freebsd.org/D52765

(cherry picked from commit f2575d56c8c9a8acad4a61a3586546dff4febce1)
DeltaFile
+12-4sys/dev/virtio/network/if_vtnet.c
+12-41 files

OPNSense/src 63f53b6share/man/man4 vtnet.4

vtnet.4: use transmit checksum offloading

Use transmit checksum offloading instead transmission checksum
offloading to be consistent with other man pages.

Reported by:    Peter Lei
Sponsored by:   Netflix, Inc.

(cherry picked from commit c7263f873ee9abb772f67b5536e2380a046e1b94)
DeltaFile
+5-5share/man/man4/vtnet.4
+5-51 files

OPNSense/src c7cd488share/man/man4 vtnet.4, sys/dev/virtio/network if_vtnet.c

vtnet: disable hardware TCP LRO by default

Hardware TCP LRO results in problems in settings with IP forwarding
being enabled. In case of nodes without IP forwarding, using
software LRO is also beneficial in general, since it can provide better
information about what was received on the wire.
Therefore, disable hardware TCP LRO by default.
By tuning the loader tunable, this can be changed.

PR:                     263229
Reviewed by:            Timo Völker
Differential Revision:  https://reviews.freebsd.org/D52684

(cherry picked from commit 6e4b811009d63f33c59d51f28fd4a030ca90843e)
DeltaFile
+17-5share/man/man4/vtnet.4
+1-1sys/dev/virtio/network/if_vtnet.c
+18-62 files

OPNSense/src b0b3245share/man/man4 vtnet.4, sys/dev/virtio/network if_vtnet.c

vtnet: improve interface capability handling

Enable the handling of the IFCAP_RXCSUM_IPV6 handling by handling
IFCAP_RXCSUM and IFCAP_RXCSUM_IPV6 as a pair. Also make clear, that
software and hardware LRO require receive checksum offload.

Reviewed by:            Timo Völker
Differential Revision:  https://reviews.freebsd.org/D52682

(cherry picked from commit eaf619fddcb21859311b895a0836da3171a01531)
DeltaFile
+11-20sys/dev/virtio/network/if_vtnet.c
+3-1share/man/man4/vtnet.4
+14-212 files

OPNSense/src 4ac0fb6share/man/man4 vtnet.4

vtnet: deprecate loader tunable fixup_needs_csum

If this tunable is enabled and vtnet receives a packet with
VIRTIO_NET_HDR_F_NEEDS_CSUM set, vtnet computes the TCP/UDP checksum
and writes it in the checksum field.
This was somewhat useful when vtnet pretended that such a packet has
a correct checksum and set the mbuf flag CSUM_DATA_VALID.
But this is not the case anymore.

Reviewed by:            tuexen
Differential Revision:  https://reviews.freebsd.org/D52546

(cherry picked from commit 5da388d93917f5fa74022960cc65452592f71539)
DeltaFile
+3-1share/man/man4/vtnet.4
+3-11 files

OPNSense/src d92ff32sys/dev/virtio/network if_vtnet.c

vtnet: Prefer "hardware" accounting for the multicast and total number of octets sent

When ALTQ is enabled, this driver does "hardware" accounting and soft
accounting at the same time. Prefer the "hardware" one to make the logic
simpler.

Reviewed by:    zlei
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D44817

(cherry picked from commit 2a346c8993cbb92a321a7c25bd9ac4dcaae352d1)
DeltaFile
+0-2sys/dev/virtio/network/if_vtnet.c
+0-21 files

OPNSense/src e71ace0sys/dev/virtio/network if_vtnet.c

vtnet: Do "hardware" accounting for the total number of received octets

While here, advertise the IFCAP_HWSTATS capability to avoid the net
stack from double counting it.

Co-authored-by: zlei
Reviewed by:    zlei
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D44816

(cherry picked from commit a14d561e58529c9686a2efc47f4828ad82026e63)
DeltaFile
+3-0sys/dev/virtio/network/if_vtnet.c
+3-01 files

OPNSense/src 244acf8sys/dev/virtio/network if_vtnet.c

vtnet: fix compilation for NOIP configs

Reported by:    bz
Fixes:          3008f30d2c2c ("vtnet: improve checksum offloading")

(cherry picked from commit 614e9b33bf5594d9d09b5d296afa4f3aa6971823)
DeltaFile
+9-0sys/dev/virtio/network/if_vtnet.c
+9-01 files

OPNSense/src 52cbb08share/man/man4 vtnet.4, sys/dev/virtio/network if_vtnet.c if_vtnetvar.h

vtnet: improve checksum offloading

When transmitting a packet over the vtnet interface, map the
csum flags CSUM_DATA_VALID | CSUM_PSEUDO_HDR to the virtio
flag VIRTIO_NET_HDR_F_DATA_VALID.
When receiving a packet over the virtio network channel, translate
the virtio flag VIRTIO_NET_HDR_F_NEEDS_CSUM not to CSUM_DATA_VALID |
CSUM_PSEUDO_HDR, but to CSUM_TCP, CSUM_TCP_IPV6, CSUM_UDP, or
CSUM_UDP_IPV6.
The second change fixes a series of issue related to checksum
offloading for if_vtnet.
While there, improve the stats counters to allow a detailed view
on what is going on in relation to checksum offloading.

PR:                     165059
Reviewed by:            tuexen, manpages
Differential Revision:  https://reviews.freebsd.org/D51686

(cherry picked from commit 3008f30d2c2cabdd7e17f7fb922139da8681ffbd)
DeltaFile
+123-119sys/dev/virtio/network/if_vtnet.c
+19-9share/man/man4/vtnet.4
+1-1sys/dev/virtio/network/if_vtnetvar.h
+143-1293 files

OPNSense/src 911cfd8share/man/man4 vtnet.4

vtnet.4: remove stray line

Reported by:    Timo Völker
Fixes:          ac87d70563f8 ("vtnet.4: improve existing descriptions and add missing ones")
Sponsored by:   Netflix, Inc.

(cherry picked from commit 491986942dd2b3be8a6f232c487b3bb7c1ea412b)
DeltaFile
+1-2share/man/man4/vtnet.4
+1-21 files

OPNSense/src 7941abcshare/man/man4 vtnet.4

vtnet.4: improve existing descriptions and add missing ones

Improve several descriptions for loader tunables and add descriptions
of the statistics provided by read only sysctl-variables.

Reviewed by:            bcr
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D51985

(cherry picked from commit ac87d70563f85d53575956c6fe40615b2e501c13)
DeltaFile
+136-6share/man/man4/vtnet.4
+136-61 files

OPNSense/src 69287adshare/man/man4 vtnet.4

vtnet.4: update description of loader tunables

This is based on the description of sysctl -d.

Reviewed by:            Timo Völker, bcr
Differential Revision:  https://reviews.freebsd.org/D51604

(cherry picked from commit 0ded4647215cffde9076ab4e82870b0f491bd0b2)
DeltaFile
+22-1share/man/man4/vtnet.4
+22-11 files

OPNSense/src 81907edsys/dev/virtio/network if_vtnet.c

vtnet: mark statistic counters with CTLFLAG_STATS

Reviewed by:    Timo Völker
Differential Revision:  https://reviews.freebsd.org/D51999

(cherry picked from commit e6253eac1ab346d70db79d638c200bffa65cae02)
DeltaFile
+42-28sys/dev/virtio/network/if_vtnet.c
+42-281 files