OPNSense/src ddc2dc3sys/netlink/route rt.c

netlink: allow force remove on pinned delete from route binary

Taken from: https://reviews.freebsd.org/D46301
DeltaFile
+2-1sys/netlink/route/rt.c
+2-11 files

OPNSense/src 0d69299sys/netlink/route iface.c

netlink/route: Fix the argument list for rtnl_handle_iflink()

This function is registered as a ifnet_link_event and so should have the
corresponding argument list.

PR:             282870
Reported by:    nakayamakenjiro at gmail.com
MFC after:      1 week

(cherry picked from commit 0289db3259532d51ebe58bc0b2647a0d9e6cae66)
DeltaFile
+1-1sys/netlink/route/iface.c
+1-11 files

OPNSense/src de00cf1sys/netlink netlink_debug.h

netlink: Wrap long lines

No functional change intended.

MFC after:      1 week
Sponsored by:   Klara, Inc.

(cherry picked from commit e536b197c0cf5c245e0b65f1b73447d53f3656f2)
DeltaFile
+11-9sys/netlink/netlink_debug.h
+11-91 files

OPNSense/src 3f1e517sys/netlink/route rt.c

netlink/route: provide pre-2.6.19 Linux compat shim

The old Linux used 8-bit rtm_table field of the RTM_NEWROUTE message to
specify routing table id.  Modern netlink uses RTA_TABLE 32-bit attribute.

Unfortunately, there is modern software (namely bird) that would prefer
the old API as long as the routing table id fits into 8-bit.

PR:             279662
(cherry picked from commit f34aca55adef1e28cd68b2e6705a0cac03f0238e)
DeltaFile
+6-1sys/netlink/route/rt.c
+6-11 files

OPNSense/src 712dd79sys/netlink netlink_snl.h netlink_snl_route_parsers.h

netlink: Fix C++ compile errors

Allow these files to be included in C++ programs with careful casting to
the proper type, like C++ wants (and in a way that also works for C).

MFC After: 1 week
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1245

(cherry picked from commit ff92493a4f6504c49a6c84ec65053f493ff5d708)
DeltaFile
+17-16sys/netlink/netlink_snl.h
+5-5sys/netlink/netlink_snl_route_parsers.h
+1-1sys/netlink/netlink_snl_route.h
+23-223 files

OPNSense/src aadc433sbin/route route.c

route: avoid overlapping strcpy

Passing overlapping buffers to strcpy yields an undefined result, so
let's avoid it. The copy doesn't really need to happen anyways, we can
just point to the domain part of the hostname.

This was discovered with _FORTIFY_SOURCE.

Sponsored by:   Klara, Inc.
Sponsored by:   Stormshield
Reviewed by:    allanjude, emaste, imp, melifaro (all previous version)

(cherry picked from commit 158f319428c10143ce2ffe766416207c75578931)
DeltaFile
+12-10sbin/route/route.c
+12-101 files

OPNSense/src 37fc954sys/netpfil/ipfw ip_fw_table_algo.c

ipfw: fix order of memcpy arguments.

This fixes `ipfw table N lookup addr` command for MAC tables.

(cherry picked from commit e012d79c9c732a6aef21066feba2e5e48833cca4)
DeltaFile
+1-1sys/netpfil/ipfw/ip_fw_table_algo.c
+1-11 files

OPNSense/src 3855bebusr.sbin/bsdinstall/distfetch distfetch.c

bsdinstall: Consistently use item count as the first argument to calloc

Reported by:    GCC 14 -Wcalloc-transposed-args
Reviewed by:    rlibby, imp, emaste
Differential Revision:  https://reviews.freebsd.org/D46012

(cherry picked from commit 7cd0a4c85dbe5e8cd000f6b293ef2d579d22edfb)
DeltaFile
+2-2usr.sbin/bsdinstall/distfetch/distfetch.c
+2-21 files

OPNSense/src 6c68c77sys/dev/sfxge sfxge.c

sfxge: defer ether_ifattach to when ifmedia_init is done #228

And educated guess that this is similar in nature to d4799c2b7b.
DeltaFile
+3-7sys/dev/sfxge/sfxge.c
+3-71 files

OPNSense/src 69961c4sys/net/route route_ctl.c route_ctl.h

Fix failure to add an interface prefix route when route with the same
 prefix is already presented in the routing table.

PR:             277125
Reported by:    Oleksandr Ignatyev <alex at i.org.ua>
Reviewed by:    ae, jlduran
Tested by:      jlduran
Differential Revision: https://reviews.freebsd.org/D47534
MFC after:      2 weeks
DeltaFile
+8-5sys/net/route/route_ctl.c
+5-5sys/net/route/route_ctl.h
+13-102 files

OPNSense/src 124e4d4sys/dev/ixgbe if_ix.c if_ixv.c

ixgbe: Style pass on FreeBSD part of driver

Fix up some indentation and reflow long lines

Sponsored by:   BBOX.io

(cherry picked from commit c58d34dd67a419866ee50f152044e49cecbae261)
DeltaFile
+469-344sys/dev/ixgbe/if_ix.c
+137-117sys/dev/ixgbe/if_ixv.c
+56-54sys/dev/ixgbe/if_bypass.c
+57-49sys/dev/ixgbe/ix_txrx.c
+30-29sys/dev/ixgbe/if_sriov.c
+12-12sys/dev/ixgbe/if_fdir.c
+761-6051 files not shown
+765-6097 files

OPNSense/src 9366fc7sys/netpfil/pf pf.c

pf: fix potential state key leak

If we fail to attach the new state keys in pf_state_key_attach() we are
expected to free both keys. Do so.
Note that in some scenarios both key are the same, so check for that
before freeing.

MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D47495

(cherry picked from commit 371bd29d4b22257a7e92e1e711cca3d94cfbd00d)
DeltaFile
+3-1sys/netpfil/pf/pf.c
+3-11 files

OPNSense/src c01582ctests/sys/netpfil/pf pflog.sh

pf: add pflog:rdr test
DeltaFile
+59-0tests/sys/netpfil/pf/pflog.sh
+59-01 files

OPNSense/src 36c27c1sys/netpfil/pf pf.c

pf: fix NAT action regression in 18af3384c #223
DeltaFile
+1-1sys/netpfil/pf/pf.c
+1-11 files

OPNSense/src 8340e06sys/dev/ixgbe if_ix.c

ixgbe: sysctl for TCP flag handling during TSO

Add tso_tcp_flags_mask_first_segment, tso_tcp_flags_mask_middle_segment,
and tso_tcp_flags_mask_last_segment sysctl-variables to control the
handling of TCP flags during TSO.

This allows to fix the masks appropriate for classical ECN and to
configure appropriate masks for accurate ECN.

Michael notes emperically 82599 has an unexpected middle mask:
Chip  First Middle Last
82599 0xFF6 0xFF6  0xF7F

which should be fixed up to 0xF76 (RFC 3168) in a future commit.

Reviewed by:    rrs, rscheff
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D44258

(cherry picked from commit eea2e089f8dadf850a30ed837edd7a386427a9ed)
DeltaFile
+56-0sys/dev/ixgbe/if_ix.c
+56-01 files

OPNSense/src 5cbfc2asys/dev/ixgbe ixgbe_phy.c

ixgbe: Add support for 1Gbit Active DAC links

1Gbit also emperically works on Active DACs.

Sponsored by:   BBOX.io

(cherry picked from commit e38f9257c3fac5cb5a62f62c424a976446ae1220)
DeltaFile
+2-1sys/dev/ixgbe/ixgbe_phy.c
+2-11 files

OPNSense/src 880f01fsys/dev/ixgbe ixgbe_82599.c if_ix.c

ixgbe: Add support for 1Gbit DAC links

This is a relatively well known trick for the X520 (82599), can be
useful for testing and lab settings.  It's not an official standard or
particularly common but ubiquitous Broadcom switch ASICs deal with it.

We'll call it 1000Base-KX because it's SerDes on the passive cable and
I don't think it's worth adding another media type for this.

Reviewed by:    emaste
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D47352

(cherry picked from commit 48ddd1b9f88753c6875566fbb67bc622453e4993)
DeltaFile
+11-0sys/dev/ixgbe/ixgbe_82599.c
+6-1sys/dev/ixgbe/if_ix.c
+2-1sys/dev/ixgbe/ixgbe_phy.c
+19-23 files

OPNSense/src 8cf79f4libexec/rc/rc.d hostid

rc: ignore this hostid
DeltaFile
+2-0libexec/rc/rc.d/hostid
+2-01 files

OPNSense/src bc68b18sys/netipsec ipsec_output.c

ipsec: fix IPv6 over IPv4 tunneling.

Properly initialize setdf variable in ipsec_encap().
It is used for AF_INET6 case when IPv6 datagram is going to be
encapsulated into IPv4 datagram.

PR:             282535
Fixes:          4046178557e1
MFC after:      1 week
DeltaFile
+4-10sys/netipsec/ipsec_output.c
+4-101 files

OPNSense/src 014bccelibexec/rc/rc.d hostid

rc: ignore this hostid
DeltaFile
+2-0libexec/rc/rc.d/hostid
+2-01 files

OPNSense/src 4e44538tests/sys/netpfil/pf pflog.sh

pf: remove "any" test since 0.0.0.0 is discarded below, see 713264f6b8

This may be against common critera specification, but it makes no sense
to test this at pf level at the moment.
DeltaFile
+0-100tests/sys/netpfil/pf/pflog.sh
+0-1001 files

OPNSense/src 2664306tests/sys/netpfil/pf pflog.sh

pf: add a log test for 0.0.0.0 which is not seen

Might be the standard behaviour but since it should be investigates
here we are.
DeltaFile
+126-0tests/sys/netpfil/pf/pflog.sh
+126-01 files

OPNSense/src 783c522tests/sys/netpfil/pf pflog.sh Makefile

pf: add a test case of how pflog should handle max directive

The second state also has "pass" which is wrong.  The test case aimes
for the right behaviour which also fails on our end because we reverted
a commit partially which allows us to see the block but the pass is
there as a third log line still.
DeltaFile
+68-0tests/sys/netpfil/pf/pflog.sh
+1-0tests/sys/netpfil/pf/Makefile
+69-02 files

OPNSense/src b66e439usr.sbin/bsdinstall bsdinstall.8, usr.sbin/bsdinstall/scripts firmware Makefile

bsdinstall: add menu to install firmware

Add a menu to the installer to run fwget(8) inside the newly installed
system to install firmware known to be needed.
This requires working netowrking.

This is needed at least for wireless currently for when we entirely
stop shipping new firmware in src.git to have working networking on
the installed system (we already do need this for at least rtw89).

Sponsored by:   The FreeBSD Foundation
Tested with:    4 different iwlwifi chipsets in a system (earlier version)
Suggested improvments by: jrtc27
Differential Revision: https://reviews.freebsd.org/D47491

(cherry picked from commit bbe2a1da2df639c616869aa838244c8094779bd4)
DeltaFile
+125-0usr.sbin/bsdinstall/scripts/firmware
+18-1usr.sbin/bsdinstall/bsdinstall.8
+1-0usr.sbin/bsdinstall/scripts/Makefile
+1-0usr.sbin/bsdinstall/scripts/auto
+145-14 files

OPNSense/src a189cf6usr.sbin/bsdinstall/scripts wlanconfig

bsdinstall: wlanconfig: fix interface UP on (re-)starting wpa_supplicant

Make sure an interface is back up before (re-)starting wpa_supplicant
in wlanconfig not relying on wpa to UP the interface (though we fixed
that).

Sponsored by:   The FreeBSD Foundation
Reviewed by:    emaste (in D47491)
Differential Revision: https://reviews.freebsd.org/D47491

(cherry picked from commit 5399052c63a7a3d2f54615d31bfd092ab887a600)
DeltaFile
+2-1usr.sbin/bsdinstall/scripts/wlanconfig
+2-11 files

OPNSense/src 9858829sys/netpfil/pf pf_lb.c

pf: Let pf_state_insert() handle redirect state conflicts

When handling a redirect state conflict, pf_get_translation() tries
modifying the source port to avoid it.  If it fails to find a free port,
the translation is aborted.

Instead, if we fail to find a free source port, simply press on with the
original source port and let pf_state_insert() handle the conflict as it
pleases, rather than second-guessing what it will do.  In particular,
pf_state_insert() has special handling for TCP connections in a terminal
state, and might succeed despite a state conflict.

Reviewed by:    kp
MFC after:      3 months
Sponsored by:   Klara, Inc.
Sponsored by:   Modirum
Differential Revision:  https://reviews.freebsd.org/D46612

(cherry picked from commit 9569fddd8d0e48211e67fdc63dd72eba83883525)
DeltaFile
+8-3sys/netpfil/pf/pf_lb.c
+8-31 files

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

pf: Make pf_get_translation() more expressive

Currently pf_get_translation() returns a pointer to a matching
nat/rdr/binat rule, or NULL if no rule was matched or an error occurred
while applying the translation.  That is, we don't distinguish between
errors and the lack of a matching rule.  This, if an error (e.g., a
memory allocation failure or a state conflict) occurs, we simply handle
the packet as if no translation rule was present.  This is not
desireable.

Make pf_get_translation() return the matching rule as an out-param and
instead return a reason code which indicates whether there was no
translation rule, or there was a translation rule and we failed to apply
it, or there was a translation rule and we applied it successfully.

Reviewed by:    kp, allanjude
MFC after:      3 months
Sponsored by:   Klara, Inc.
Sponsored by:   Modirum

    [3 lines not shown]
DeltaFile
+38-19sys/netpfil/pf/pf_lb.c
+14-4sys/netpfil/pf/pf.c
+3-2sys/net/pfvar.h
+55-253 files

OPNSense/src 28b3419share/man/man5 pf.conf.5, sys/netpfil/pf pf_lb.c

pf: Let rdr rules modify the src port if doing so would avoid a conflict

If NAT rules cause inbound connections to different external IPs to be
mapped to the same internal IP, and some application uses the same
source port for multiple such connections, rdr translation may result in
conflicts that cause some of the connections to be dropped.

Address this by letting rdr rules detect state conflicts and modulate
the source port to avoid them.

Reviewed by:    kp, allanjude
MFC after:      3 months
Sponsored by:   Klara, Inc.
Sponsored by:   Modirum
Differential Revision:  https://reviews.freebsd.org/D44488

(cherry picked from commit 9897a66923a3e79c22fcbd4bc80afae9eb9f277c)
DeltaFile
+100-0tests/sys/netpfil/pf/rdr.sh
+63-7sys/netpfil/pf/pf_lb.c
+20-0tests/sys/netpfil/pf/rdr-srcport.py
+7-2share/man/man5/pf.conf.5
+1-0tests/sys/netpfil/pf/Makefile
+191-95 files

OPNSense/src 7881c10tests/sys/netpfil/pf rdr.sh

pf: Correct SPDX identifier

Pointed out by: Mike Karels <karels at FreeBSD.org>

(cherry picked from commit 3db693f7da8a1aaf0a8887e7791ebb5d67c7a2d9)
DeltaFile
+1-1tests/sys/netpfil/pf/rdr.sh
+1-11 files

OPNSense/src 6b038d3tests/sys/netpfil/pf rdr.sh Makefile

pf: Add a TCP rdr test on IPv6

Reviewed by:    kp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision: https://reviews.freebsd.org/D42105

(cherry picked from commit b9870ba93ea90a12f5a5727c80f7958b17f9afcc)
DeltaFile
+127-0tests/sys/netpfil/pf/rdr.sh
+1-0tests/sys/netpfil/pf/Makefile
+128-02 files