OPNSense/core dd46067src/opnsense/mvc/app/models/OPNsense/Firewall Filter.php, src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations MFP1_0_4.php

mvc: style sweep
DeltaFile
+1-1src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.php
+1-1src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_4.php
+2-22 files

OPNSense/core 4489190. plist

plist
DeltaFile
+4-2plist
+4-21 files

OPNSense/core cd81bccsrc/opnsense/mvc/app/controllers/OPNsense/Firewall/Api OneToOneController.php, src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms dialogOneToOneRule.xml

Firewall: NAT: One-to-One - refactor to MVC, closes https://github.com/opnsense/core/issues/7250
DeltaFile
+0-475src/www/firewall_nat_1to1_edit.php
+0-410src/www/firewall_nat_1to1.php
+107-0src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/MFP1_0_4.php
+81-0src/opnsense/mvc/app/controllers/OPNsense/Firewall/forms/dialogOneToOneRule.xml
+71-1src/opnsense/mvc/app/models/OPNsense/Firewall/Filter.xml
+67-0src/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/OneToOneController.php
+326-8868 files not shown
+439-90714 files

OPNSense/core 6f24db1src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes ContainerField.php

mvc/model/ContainerField - pass isFieldChanged() to children.

Noticed this issue while working on filter validations, which seemed to re-validate each item on every migration due to FieldTypes inheriting from ContainerField.
This is a minor change, but will prevent record validations from triggering unnecessary.
DeltaFile
+12-0src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/ContainerField.php
+12-01 files

OPNSense/src 8160372sys/kern kern_timeout.c

Set pin_default_swi to 0 by default
DeltaFile
+1-1sys/kern/kern_timeout.c
+1-11 files

OPNSense/src d54a1c8sys/net rss_config.c if_gre.c, sys/netinet ip_input.c

rss: add sysctl enable toggle

This commit also includes the original refactoring changes

This change allows the kernel to operate with the default netisr cpu-affinity settings while having RSS compiled in. Normally, RSS changes quite a bit of the behaviour of the kernel dispatch service - this change allows for reducing impact on incompatible hardware while preserving the option to boost throughput speeds based on packet flow CPU affinity.

Make sure to compile the following options in the kernel:

    options  RSS
    options  PCBGROUP

As well as setting the following sysctls:

    net.inet.rss.enabled: 1
    net.isr.bindthreads: 1
    net.isr.maxthreads: -1 (automatically sets it to the number of CPUs)

And optionally (to force a 1:1 mapping between CPUs and buckets):


    [4 lines not shown]
DeltaFile
+37-1sys/net/rss_config.c
+20-0sys/netinet6/ip6_input.c
+12-7sys/net/if_gre.c
+19-0sys/netinet/ip_input.c
+7-0sys/netinet6/frag6.c
+6-0sys/netinet6/ip6_output.c
+101-810 files not shown
+130-916 files

OPNSense/core 697992bsrc/opnsense/mvc/app/models/OPNsense/Base/FieldTypes NetworkAliasField.php

mvc/model - implement getDescription() in NetworkAliasField. As this field type acts as a single (non-list) type, we need to return the description from here as well as BaseListField's implementation doesn't apply here.
DeltaFile
+12-0src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/NetworkAliasField.php
+12-01 files

OPNSense/core b139e33src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes BaseListField.php

mvc/model - BaseListField replace array_map+strval for loop with cast to preserve execution time. The mapping with strval seems to be rather slow, a simple cast seems to be roughly 4 times faster.
DeltaFile
+5-2src/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseListField.php
+5-21 files

OPNSense/core f652640src/opnsense/www api.php

MVC: deal with explicit buffering on Phalcon side

The start() and finish() methods in Phalcon start and close an output buffer respectively. If we clear this buffer prematurely, as is needed for streaming data, we must handle the exception that pops up as a result of Phalcon trying to close the buffer again. In cases where such control over the output is needed, we must also assume that the headers have already been sent, so silence the output in this case to prevent a PHP fatal error.
DeltaFile
+11-1src/opnsense/www/api.php
+11-11 files

OPNSense/src 678a1afsys/netinet ip_output.c ip_fastfwd.c, sys/netinet6 ip6_output.c ip6_fastfwd.c

pf|ipfw|netinet6?: shared IP forwarding

This removes the if_output calls in the pf(4) code that escape further
processing by defering the forwarding execution to the network stack
using on/off style sysctls for both IPv4 and IPv6.

Also see: https://reviews.freebsd.org/D8877
DeltaFile
+136-12sys/netinet6/ip6_output.c
+107-9sys/netinet/ip_output.c
+30-46sys/netinet6/ip6_fastfwd.c
+28-46sys/netpfil/ipfw/ip_fw_pfil.c
+34-29sys/netinet6/ip6_forward.c
+25-34sys/netinet/ip_fastfwd.c
+360-1766 files not shown
+439-22912 files

OPNSense/core 50bd3dcsrc/opnsense/mvc/app/library/OPNsense/Trust Store.php

Trust: swapped issuer and subject in parseX509(), closes https://github.com/opnsense/core/issues/7389
DeltaFile
+2-2src/opnsense/mvc/app/library/OPNsense/Trust/Store.php
+2-21 files

OPNSense/src 82d5531sys/netinet ip_output.c ip_fastfwd.c, sys/netinet6 ip6_output.c ip6_fastfwd.c

pf|ipfw|netinet6?: shared IP forwarding

This removes the if_output calls in the pf(4) code that escape further
processing by defering the forwarding execution to the network stack
using on/off style sysctls for both IPv4 and IPv6.

Also see: https://reviews.freebsd.org/D8877
DeltaFile
+136-12sys/netinet6/ip6_output.c
+107-9sys/netinet/ip_output.c
+30-46sys/netinet6/ip6_fastfwd.c
+28-46sys/netpfil/ipfw/ip_fw_pfil.c
+34-29sys/netinet6/ip6_forward.c
+25-34sys/netinet/ip_fastfwd.c
+360-1766 files not shown
+439-22912 files

OPNSense/src f94dd9csys/dev/ixgbe ixgbe_phy.c if_ix.c

sys/dev/ixgbe - workaround to prevent an i2c bus read to keep trying to read an empty slot.

When executing `ifconfig -v` this will lead to stalls for a second per interface due to the timeout being set to a static 10 without a module placed, this patch makes sure this is only allowed once per insertion.
DeltaFile
+12-0sys/dev/ixgbe/ixgbe_phy.c
+5-0sys/dev/ixgbe/if_ix.c
+2-0sys/dev/ixgbe/ixgbe_type.h
+19-03 files

OPNSense/src 09b6c63sys/dev/axgbe xgbe-phy-v2.c xgbe-sysctl.c

axgbe: remove old annotations and a bit of whitespace cleanup
DeltaFile
+8-8sys/dev/axgbe/xgbe-phy-v2.c
+2-2sys/dev/axgbe/xgbe-sysctl.c
+1-1sys/dev/axgbe/if_axgbe_pci.c
+1-1sys/dev/axgbe/xgbe-dev.c
+12-124 files

OPNSense/src 3b27b51share/man/man4 wg.4, sys/dev/wg if_wg.c

wg: Add netmap support

When in netmap (emulated) mode, wireguard interfaces prepend or strip a
dummy ethernet header when interfacing with netmap.  The netmap
application thus sees unencrypted, de-encapsulated frames with a fixed
header.

In this mode, netmap hooks the if_input and if_transmit routines of the
ifnet.  Packets from the host TX ring are handled by wg_if_input(),
which simply hands them to the netisr layer; packets which would
otherwise be tunneled are intercepted in wg_output() and placed in the
host RX ring.

The "physical" TX ring is processed by wg_transmit(), which behaves
identically to wg_output() when netmap is not enabled, and packets
appear in the "physical" RX ring by hooking wg_deliver_in().

Reviewed by:    vmaffione
MFC after:      1 month

    [3 lines not shown]
DeltaFile
+149-6sys/dev/wg/if_wg.c
+14-0share/man/man4/wg.4
+163-62 files

OPNSense/src d4b875e.github CODEOWNERS, .github/ISSUE_TEMPLATE bug_report.md

github: sync our issue template and remove FreeBSD stuff
DeltaFile
+0-105.github/CODEOWNERS
+0-66.github/workflows/cross-bootstrap-tools.yml
+55-0.github/ISSUE_TEMPLATE/bug_report.md
+0-16.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
+55-1874 files

OPNSense/src 9181896stand/efi/loader main.c bootinfo.c

stand: add EFI support for mmio serial consoles

When no legacy serial is found, we may be looking at a non-legacy mmio
serial device mapping, in which case the efi_devpath_name() for name
ConOutDev looks like this:

    VenHw(XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX,0090DCFE00000000)/Uart(115200,8,N,1)/VenVt100()

Which should tell the kernel to attach a console to 0xfedc9000
(little endian 64 bit value).  The value is stored behind the
VENDOR_DEVICE_PATH struct as a byte stream hence we need to check
if said address is appended behind the node.  Also enforce use for
uart by requiring the console speed read from the same device.

There is no scientific process for "rs:2" derivation, but evidence would
indicate that this is the correct setting for existing MMIO EFI consoles.

See also: http://bsdimp.blogspot.com/2018/07/how-to-get-memory-mapped-serial-console.html
DeltaFile
+18-0stand/efi/loader/main.c
+8-0stand/efi/loader/bootinfo.c
+26-02 files

OPNSense/src 55e365dsys/dev/axgbe if_axgbe_pci.c

axgbe: enable RSF to prevent zero-length packets while in Netmap mode

Initially, RSF (Receive Queue Store and Forward) was disabled for
unknown reasons, but the cut-through mode that's enabled as a result
seems to send 0 length packets up to the DMA when the RX queue is
full.
DeltaFile
+1-1sys/dev/axgbe/if_axgbe_pci.c
+1-11 files

OPNSense/src 1b001a9sys/dev/axgbe xgbe-phy-v2.c

axgbe: account for 4 SFP ports during GPIO expander check
DeltaFile
+36-36sys/dev/axgbe/xgbe-phy-v2.c
+36-361 files

OPNSense/src 33f308csys/dev/axgbe xgbe-phy-v2.c xgbe-i2c.c

axgbe: gracefully handle i2c bus failures

In (unknown) situations it seems the i2c bus can have trouble,
while nothing about the current link state has changed, the driver
would react by going into a link down state, and start busylooping
on up to 4 cores. Even if there was a valid link, such spinning
on a cpu by a kernel thread would wreak havoc to existing and
new connections.

This patch does the following:
1. If such a bus failure occurs, we keep the last known link state.
2. Prevent busy looping by implementing the lockmgr() facility to
be able to sleep while the i2c code waits on the i2c ISR. We cap
this with a timeout.
3. Pin the admin queues to the last CPU in the system, to prevent
other scenarios where busy looping might occur from landing on CPU
0, which especially seems to cause a lot of issues.

Given the design constraints both in hardware and in software,

    [9 lines not shown]
DeltaFile
+62-29sys/dev/axgbe/xgbe-phy-v2.c
+37-13sys/dev/axgbe/xgbe-i2c.c
+4-1sys/dev/axgbe/xgbe-mdio.c
+5-0sys/dev/axgbe/xgbe.h
+2-1sys/dev/axgbe/if_axgbe_pci.c
+1-1sys/dev/axgbe/xgbe-phy-v1.c
+111-456 files

OPNSense/src bd9e5b7sys/dev/axgbe xgbe-phy-v2.c xgbe-mdio.c

axgbe: LED control for A30 platform

Since the I/O expander chip does not do a reset when soft power
cycling, the driver will first turn off all LEDs when initializing,
although no specific routine seems to be called when powering down.
This means that the LEDs will stay on until the driver has booted up,
after which the driver will be in a consistent state.
DeltaFile
+86-0sys/dev/axgbe/xgbe-phy-v2.c
+11-2sys/dev/axgbe/xgbe-mdio.c
+10-0sys/dev/axgbe/xgbe.h
+107-23 files

OPNSense/src 7022117sys/dev/axgbe xgbe-phy-v2.c

axgbe: exclude 10G modules from miibus interface
DeltaFile
+3-0sys/dev/axgbe/xgbe-phy-v2.c
+3-01 files

OPNSense/src 5815b71sys/dev/axgbe xgbe-phy-v2.c

axgbe: also validate configuration register in GPIO expander

It is possible for a machine to boot into a state in which the configuration register,
responsible for controlling wether an I/O signal is considered an input or output,
contains randomized values. It was assumed this was programmed by the BIOS.

If I/O is reversed, it's possible for the driver to think an SFPP module has been inserted
when there is none, leading to unrecoverable I2C errors.

The configuration register should contain a state which is determined and provided by the BIOS,
hence no hard-coded values are programmed here.
DeltaFile
+50-27sys/dev/axgbe/xgbe-phy-v2.c
+50-271 files

OPNSense/src 34658d9sys/dev/axgbe xgbe-phy-v2.c xgbe-mdio.c

axgbe: move phy_stop to axgbe_if_detach()

Since the iflib interface needs axgbe_pci_init() and its phy starting capabilities, no data was passed in its absence.

With the NULL check of the axgbe_miibus we also resort back to an MDIO read as a module might be capable of both
clause 22 and clause 45 methods of communication.

with the move of phy_stop() to if_detach() in https://github.com/opnsense/src/commit/d50d4e8cd499882d4ac77765797a81306e316795, it's better to prevent reconfiguring the phy should the pci_init() callout trigger more than once.
DeltaFile
+7-0sys/dev/axgbe/xgbe-phy-v2.c
+5-1sys/dev/axgbe/xgbe-mdio.c
+1-3sys/dev/axgbe/if_axgbe_pci.c
+13-43 files

OPNSense/src de3f96dsys/dev/axgbe xgbe-phy-v2.c xgbe-mdio.c

axgbe: fix link issues for gigabit external SFP PHYs and 100/1000 fiber modules

Within the code path of autonegotiation for gigabit SFP modules was a bug, causing
a report of LINK_ERR for cases where an external SFP PHY was present. Fixing this issue
did not resolve to a link however, as it turned out that while autonegotiation interrupts
were happening, it's resulting status cannot be correctly determined in all cases. In these
specific cases we have no other option than to assume a module has negotiated to 1Gbit/s.

PHY-specific configuration has been delegated to the miibus driver, if an external PHY is present.
It's possible that the i2c bus does not recognize a PHY on the first pass, so in all cases we
retry up to a maximum of 5 times during each link poll pass to ensure we didn't miss the presence
of an external PHY.

This commit also addresses link issues on both 100 mbit and 1Gb fiber modules. Not all of these modules
have the correct data set according to SFF-8472, as such we first check for gigabit compliance and
the associated baudrate, otherwise we resort back to determining what type of fiber module is plugged
in by checking the baudrate, cable length and wavelength and setting the MAC speed accordingly.
DeltaFile
+96-20sys/dev/axgbe/xgbe-phy-v2.c
+1-5sys/dev/axgbe/xgbe-mdio.c
+1-1sys/dev/axgbe/xgbe-i2c.c
+98-263 files

OPNSense/src 995eeb5sys/dev/axgbe xgbe-phy-v2.c

axgbe: apply RRC to miibus attached PHYs and add support for variable bitrate 25G SFP+ DACs
DeltaFile
+43-16sys/dev/axgbe/xgbe-phy-v2.c
+43-161 files

OPNSense/src 118be78sys/dev/axgbe xgbe-phy-v2.c if_axgbe_pci.c

axgbe: several patches from 22.1 not yet present in FreeBSD
DeltaFile
+212-12sys/dev/axgbe/xgbe-phy-v2.c
+66-24sys/dev/axgbe/if_axgbe_pci.c
+24-0sys/dev/axgbe/xgbe-common.h
+14-0sys/dev/axgbe/xgbe-sysctl.c
+9-1sys/dev/axgbe/xgbe-dev.c
+1-6sys/dev/axgbe/xgbe-txrx.c
+326-433 files not shown
+330-489 files

OPNSense/src 5d63badlib/libnetmap nmreq.c

libnetmap: remove interface name validation

When trying to use a VLAN device (e.g. "em0.123") with a dot
the library fails to parse the interface correctly. The former
pattern is much too restrictive given that almost all characters
can be coerced into a device name via ifconfig.

Remove the particularly restrictive validation.  Some characters
still cannot be used as an interface name as they are used as
delimiters in the syntax, but this allows to be able to use most
of them without an issue.

Submitted by:   franco at opnsense.org
Differential Revision:  https://reviews.freebsd.org/D42485
Reviewed by:    vmaffione

(cherry picked from commit ad874544d9f018bf8eef4053b5ca7b856c4674cb)
DeltaFile
+0-5lib/libnetmap/nmreq.c
+0-51 files

OPNSense/src 699f7c9sys/netpfil/pf if_pflog.c

pflog: log packet dropped by default rule with drop

Taken from: https://github.com/openbsd/src/commit/7b8683a1743e7
DeltaFile
+3-1sys/netpfil/pf/if_pflog.c
+3-11 files

OPNSense/src df21abflibexec/rc rc.subr, share/man/man8 rc.subr.8

rc: also run NAME_setup on NAME_reload

Reload is used for service reconfiguration as well
and lacks a NAME_prepend-like mechanism so it makes
sense to extend the NAME_reload hook into this
action.

precmd may use configuration checks and blocks setup
from doing its designated work (e.g. nginx). In moving
the invoke of the setup script in front allows us to
provide custom scripts for config file generation and
fixing prior to precmd checking configuration integrity.

Also introduce _run_rc_setup to separate the launcher
from the main one. Let it run correctly in the case
of restart_precmd and block further execution as
would be the case in start due to the internal plumbing
of restart being split into calling stop and start
afterwards.

    [2 lines not shown]
DeltaFile
+45-24libexec/rc/rc.subr
+10-3share/man/man8/rc.subr.8
+55-272 files