OPNSense/src cbaf3aasys/netpfil/pf pf.c

pf: explicitly NULL state key pointers

After the pf_state_insert() call we may not use these pointers again.
Explicitly NULL them to ensure we don't.
Also NULL them out if we free the keys directly.

Reviewed by:    glebius, markj
MFC after:      3 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D49553

(cherry picked from commit 592418343348bcf4355c249f53cff89ed90ea1f5)
DeltaFile
+4-0sys/netpfil/pf/pf.c
+4-01 files

OPNSense/src eb470a3sys/net pfvar.h, sys/netpfil/pf pf.c

pf: fix panic in pf_return()

We (correctly) NULL out sk and nk before calling pf_return(), but that
function still tried to use them to undo NAT transformations.

Store the old port numbers and use those rather than sk/nk.

This is a partial import of e11dacbf8484adc7bbb61b20fee3ab8385745925
(osport/odport), and the missing parts of
bdea9cbcf2decafeb4da5a0280313efccc09e1b3.

Direct commit to stable/14.

PR:             287254
DeltaFile
+16-15sys/netpfil/pf/pf.c
+4-2sys/net/pfvar.h
+20-172 files

OPNSense/src da44116sys/net pfvar.h, sys/netpfil/pf pf.c

pf: don't use state keys after pf_state_insert()

pf_state_insert() may free the state keys, it's not safe to access these
pointers after the call.

Introduce osrc/odst (similar to osport/odport) to store the original source and
destination addresses. This allows us to undo NAT transformations without having
to access the state keys.

Reviewed by:    glebius, markj
MFC after:      3 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D49551

(cherry picked from commit bdea9cbcf2decafeb4da5a0280313efccc09e1b3)
DeltaFile
+8-4sys/netpfil/pf/pf.c
+4-2sys/net/pfvar.h
+12-62 files

OPNSense/src 7a01869sys/netipsec ipsec.h

ipsec(4): Fix a typo in a source code comment

- s/limitiation/limitation/

(cherry picked from commit 56a9d245eb16e774fece0334fcf0761058d59a0c)
DeltaFile
+1-1sys/netipsec/ipsec.h
+1-11 files

OPNSense/src 750b980sys/netinet6 icmp6.c ip6_forward.c

netinet6: Do not forward or send ICMPv6 messages to the unspec address

As in f7174eb2b4c4 ("netinet: Do not forward or ICMP response to
INADDR_ANY"), the IPv6 stack should avoid sending packets to the
unspecified address.  In particular:
- Make sure that we do not forward received packets to the unspecified
  address; the check in ip6_input() catches this in the common case, but
  after commit 40faf87894ff it's possible for a pfil hook to bypass this
  check and pass the packet to ip6_forward() using the
  PACKET_TAG_IPFORWARD tag.
- Make sure that we do not reflect packets back to the unspecified
  address; RFC 4443 section 2.4 states that we must not generate error
  messages in response to packets from the unspecified address.

Reviewed by:    zlei, glebius
Reported by:    Franco Fichtner <franco at opnsense.org>
MFC after:      1 month
Sponsored by:   Klara, Inc.
Sponsored by:   OPNsense

    [3 lines not shown]
DeltaFile
+6-0sys/netinet6/icmp6.c
+2-1sys/netinet6/ip6_forward.c
+8-12 files

OPNSense/src 863b569sys/netinet6 icmp6.c ip6_forward.c

Revert "netinet6: do not forward to the unspecified address"

This reverts commit da1ef9f51315caf0bf1936d3966b160ba96544dd.
DeltaFile
+0-5sys/netinet6/icmp6.c
+1-2sys/netinet6/ip6_forward.c
+1-72 files

OPNSense/src 3d3c46esys/net if.c

ifnet: Integrate if_unroute() into if_down()

if_unroute() is static since 2004 and is not used anywhere except for
if_down().

This also makes it easier to grep by the pattern `if_flags &= ~IFF_UP`.

No functional change intended.

Reviewed by:    glebius
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D49356

(cherry picked from commit 0693c3f7cb3d9e5389863a0c131ddef799c77091)
DeltaFile
+8-21sys/net/if.c
+8-211 files

OPNSense/src 1b0b918sys/net if.c

ifnet: Fix a typo in a source code comment

- s/possiable/possible

MFC after:      3 days

(cherry picked from commit ad2d7e594f6d519be6e9674c8048a406a453fef9)
DeltaFile
+1-1sys/net/if.c
+1-11 files

OPNSense/src 80a7625usr.sbin/bsdinstall/scripts zfsboot

zfsboot: fix misuse of the phrase zpool

A pool is not a zpool.

Reviewed by:    jbh, ivy
Approved by:    des (mentor)
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1569

(cherry picked from commit f69afe4201ff33da0b3c3ca464a92e2e0b07ac43)
DeltaFile
+15-15usr.sbin/bsdinstall/scripts/zfsboot
+15-151 files

OPNSense/src bac53bbsys/net if_bridgevar.h

net/if_bridgevar.h: add include guard

Reviewed by:    kp
Approved by:    des (mentor)

(cherry picked from commit f6aedb956ef154828c4bfaddaa5d5eb2dda5225c)
DeltaFile
+5-0sys/net/if_bridgevar.h
+5-01 files

OPNSense/src ff48de9sys/netinet sctp_bsd_addr.c

sctp: ensure correct sctp_gather_internal_ifa_flags usage

sctp_gather_internal_ifa_flags() expects an IPv6 address.

(cherry picked from commit 4ca1395c5a311989fc02ceb7a2d44aa5eb1a7426)
DeltaFile
+3-0sys/netinet/sctp_bsd_addr.c
+3-01 files

OPNSense/src 5c14eedsys/netinet sctp_pcb.c

sctp: compute address flags only for IPv6 addresses

Only call sctp_gather_internal_ifa_flags() for IPv6 addresses and
also compile this code only, when IPv6 is supported.
This fixes the compilation of IPv4 only kernels.

Reported by:    bz@
Fixes:          6ab4b0c0df57 ("sctp: initilize local address flags correctly")

(cherry picked from commit 99c58ad021b2f7dc0496e16d313c5e28a552f0d0)
DeltaFile
+16-3sys/netinet/sctp_pcb.c
+16-31 files

OPNSense/src 98cbc70sys/netinet sctp_pcb.c

sctp: clear the SCTP_ADDR_VALID flag when removing an address

This flag is currently not read, therefore the bug had no
consequences.

(cherry picked from commit 2013c4e0dc73a7c7b05f48726af1a4931686ccef)
DeltaFile
+1-1sys/netinet/sctp_pcb.c
+1-11 files

OPNSense/src 9aba257sys/netinet sctp_pcb.c

sctp: initilize local address flags correctly

Use the same routine for initilizing as for updating.

(cherry picked from commit 6ab4b0c0df57775fd6c288a0b7d0f5d2cad73481)
DeltaFile
+3-1sys/netinet/sctp_pcb.c
+3-11 files

OPNSense/src 9a3c8desys/netinet sctp_sysctl.c

sctp: don't report unusable addresses via sysctl interface

When reporting the local addresses of an endpoint (inp without
stcb), ignore unusable addresses.

(cherry picked from commit 8f5f6680efa28135bf37f3def2aa71f35bd30333)
DeltaFile
+4-0sys/netinet/sctp_sysctl.c
+4-01 files

OPNSense/src fd36817sys/netinet sctp_pcb.c

sctp: report address unavailability consistently

When binding to an address, which is not available, use
consistently EADDRNOTAVAIL.

(cherry picked from commit 79952cd7649b63fa312ecafcffb719f5060929d4)
DeltaFile
+1-1sys/netinet/sctp_pcb.c
+1-11 files

OPNSense/src 49b65acsys/netinet sctp_bsd_addr.c

sctp: fix mapping of interface address flags

Do not clear the SCTP_ADDR_IFA_UNUSEABLE flag, if it was set due
to the address being deprecated. Also don't declare tentative
addresses as unusable.
While there, cleanup the code.

PR:             230242

(cherry picked from commit 9639de2a6f7eec8b2158782fbfab3419d507fdc5)
DeltaFile
+9-11sys/netinet/sctp_bsd_addr.c
+9-111 files

OPNSense/src 04c9d84sys/netinet6 in6.c

in6_control_ioctl: correctly report errors from SIOCAIFADDR_IN6

we have to use 'goto out' here rather than 'break' because otherwise
error is set to 0, which means the error is not propagated back to the
caller.

Reviewed by:    kp

(cherry picked from commit 1408670c90ae38fd51ea6aaabe46757bc880608e)
DeltaFile
+1-1sys/netinet6/in6.c
+1-11 files

OPNSense/src 8650ff0sys/net if_dl.h

net/if_dl.h: add param names in prototypes

previously these _KERNEL functions were inconsistent, with some having
parameter names and some not.  fix this by giving them all names, per
style(9).

Reviewed by:    thj, des
Approved by:    des (mentor)
Differential Revision:  https://reviews.freebsd.org/D50219

(cherry picked from commit 8c7d193e3cbe3d1c9a7f7869f1748bebefabaccf)
DeltaFile
+3-2sys/net/if_dl.h
+3-21 files

OPNSense/src 3e2f16fsys/net if_bridge.c ethernet.h

sys/net: add a new ether_vlanid_t type

ether_vlanid_t is a type to represent a VLAN ID, for example inside a
.1q tag.  since this is specific to Ethernet, put it in net/ethernet.h.

change bridge to use the new type instead of uint{16,32}_t.

Reviewed by:    adrian, kp
Differential Revision:  https://reviews.freebsd.org/D49836

(cherry picked from commit 96f830456fd449c4cb5a7df8a2f6c3c96993b43e)
DeltaFile
+16-12sys/net/if_bridge.c
+5-0sys/net/ethernet.h
+1-1sys/net/if_bridgevar.h
+22-133 files

OPNSense/src f4b85ecsys/dev/axgbe if_axgbe_pci.c xgbe-common.h

axgbe: add support for Yellow Carp Ethernet device
DeltaFile
+4-0sys/dev/axgbe/if_axgbe_pci.c
+2-0sys/dev/axgbe/xgbe-common.h
+6-02 files

OPNSense/src 1ef7596sys/dev/axgbe if_axgbe_pci.c xgbe-common.h

axgbe: add support for Yellow Carp Ethernet device
DeltaFile
+4-0sys/dev/axgbe/if_axgbe_pci.c
+2-0sys/dev/axgbe/xgbe-common.h
+6-02 files

OPNSense/src f88132dsys/dev/axgbe if_axgbe_pci.c xgbe-drv.c

Revert "axgbe: adjust for jumbo frames"

https://github.com/opnsense/src/issues/251

This reverts commit f2e51f2174229edd6376099a7cc35c1bd60b68d6.
DeltaFile
+2-2sys/dev/axgbe/if_axgbe_pci.c
+1-1sys/dev/axgbe/xgbe-drv.c
+3-32 files

OPNSense/src 2f20d7bsys/compat/linuxkpi/common/include/linux leds.h

LinuxKPI: extend struct and enum for leds

An updated rtw88 driver requires minimal changes to leds.h.  On
the positive side we can now remove the __DUMMY from the enum as we
actually have a valid field name.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D50002

(cherry picked from commit 69880fede78fc769ad417e5a984fb9fee7815d8b)
DeltaFile
+2-1sys/compat/linuxkpi/common/include/linux/leds.h
+2-11 files

OPNSense/src e7fe329sys/contrib/dev/rtw89 mac80211.c

rtw89: fix build
DeltaFile
+1-0sys/contrib/dev/rtw89/mac80211.c
+1-01 files

OPNSense/src 565b50dsys/compat/linuxkpi/common/include/linux pci_ids.h

LinuxKPI: add ASMEDIA vendor ID for PCI

This is needed for rtw89 updates.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste, zarychtam_plan-b.pwste.edu.pl
Differential Revision: https://reviews.freebsd.org/D50000

(cherry picked from commit c8e2458de590d7427ef3311412b8ddbc326cd3b5)
DeltaFile
+1-0sys/compat/linuxkpi/common/include/linux/pci_ids.h
+1-01 files

OPNSense/src 8168e9csys/compat/linuxkpi/common/include/net mac80211.h, sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: introduce mlo field to sta

Driver updates introduce a new field "mlo" to the sta.
Add the field to the struct and initialize it in the 802.11 compat
code along with a IMPROVE so once we get to 11be we can deal with it.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 71034267d861c183297bb209770004751f0e30c5)
DeltaFile
+2-0sys/compat/linuxkpi/common/src/linux_80211.c
+1-0sys/compat/linuxkpi/common/include/net/mac80211.h
+3-02 files

OPNSense/src f20e1f6sys/compat/linuxkpi/common/include/linux container_of.h

LinuxKPI: add container_of_const()

Implement container_of_const() needed for wireless driver updates.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D49999

(cherry picked from commit 6841b9987e83fdd9a5b05ceafc20811469222d8b)
DeltaFile
+8-0sys/compat/linuxkpi/common/include/linux/container_of.h
+8-01 files

OPNSense/src a072e67usr.sbin/bsdinstall/scripts auto

bsdinstall: Use a login shell for final configuration.

If the user accepts our offer of a shell to perform final configuration
tasks before rebooting, start a login shell.  This ensures it will have
the correct PATH and be able to install packages without issues.

PR:             286722
MFC after:      3 days
Reviewed by:    jrtc27, allanjude, emaste
Differential Revision:  https://reviews.freebsd.org/D50297

(cherry picked from commit 5870d6a1ef4ec5d6fc91d0f1635bca59e09a040d)
DeltaFile
+1-1usr.sbin/bsdinstall/scripts/auto
+1-11 files

OPNSense/src f2e51f2sys/dev/axgbe if_axgbe_pci.c xgbe-drv.c

axgbe: adjust for jumbo frames
DeltaFile
+2-2sys/dev/axgbe/if_axgbe_pci.c
+1-1sys/dev/axgbe/xgbe-drv.c
+3-32 files