12873 Commits

Author SHA1 Message Date
Franco Fichtner
e6518fcd14 interfaces: simplify as others like gif and gre do #4622 2022-06-30 16:46:11 +02:00
Franco Fichtner
b77d6ba74c dhcp: remove ifconfig invoke #4622
Seems to originate from pppoe server code which is long gone.
2022-06-30 16:46:05 +02:00
Franco Fichtner
f588e8d0c4 system: get rid of manual ifconfig invoke #4622
Likely tries to do what unassigning an interface should do.  Use
the actual function required.
2022-06-30 16:26:19 +02:00
Franco Fichtner
bd3b261f9c system: make set_single_sysctl() snappier et al; closes #5467
While set_single_sysctl() is still somewhat problematic as it
trashes things set by tunables GUI the amount of overlap is
minimal and to some degree unavoidable like the CARP handling
this manually according to user requirements set through related
configuration options.
2022-06-30 13:39:17 +02:00
Franco Fichtner
ab330cf909 system: exclusive lock on /var/run/booting #5841
As soon as rc.bootup execution ended it is safe to acquire
a shared lock on the file making it obsolete to check for
its existence with its previous caveats.

For the time before rc.bootup just assume that nothing
can happen around dynamic network backend reloads as
interfaces are only configured inside rc.bootup.
2022-06-30 13:13:43 +02:00
Franco Fichtner
0948dd69bb system: make this more generic to fit previous #5841 2022-06-30 11:22:56 +02:00
Franco Fichtner
0499fb699c system: we seem to be restarting syslog later #5841
Which is better than this interim reload while blocking dynamic
backend scripts we want to be leaveraging.
2022-06-30 11:15:05 +02:00
Franco Fichtner
d6826b15e6 interfaces: stop last internal use of /var/run/booting #5637
At last, we seem to be free...

To be precise here move staticarp configure before reload
block in interface_configure() to avoid passing a stale
ifconfig cache as that would trigger a transition twice.
Pass ifconfig cache from where it is available or read it
on the fly (e.g. rc.linkup).

With that cache we can figure out if a transition is required
and so can avoid most of the boot stalling except when staticarp
is enabled on a lot of interfaces, but that was always slow(er)
later on.  It should even be faster now avoiding the ifconfig
in the common case.

There is a side effect that dhcp wants to populate the ARP
table and that is still unconditional because we do not know
whether we have new entries added or others removed.  Having
them removed might leave them in the ARP table for longer
than necessary, however.

It's not that the current implementation is particularly bad,
but it relies heavily on implied regular flushing of ARP entries
just to keep a consistent functionality which is a big design
flaw.  As a stopgap measure remove an ARP entry when we delete
the static mapping for it to keep the entries in sync.

/var/run/booting remains in backend scripts that should not
interfere with boot but we will clean these up later as they
do not need removal but rather a transition to a safer way
than checking for a file (that might not get deleted for
one reason or another.. it has been known to happen).
2022-06-30 10:52:27 +02:00
Franco Fichtner
5615b9dc87 interfaces: simplify the staticarp code and make the problem worse #5637
According to dhcp server the static arp setting persists through a
disabled server but doesn't trigger on disabled or when the staticarp
flag is actually set.  To keep the current flow make the configuration
unconditional which makes the problem we are trying to solve worse.

There are 3 callers to the function interfaces_staticarp_configure()
and rc.linkup is one that is not called when booting so it's not our
problem.  The remaining two in interfaces.inc and dhcpd.inc should get
to see if staticarp needs to be flipped and thus execute the arp flush
as well under this particular condition.
2022-06-30 09:27:08 +02:00
Franco Fichtner
c7e67c6752 firewall: append missing link-local to inet6 :network selector #5528 2022-06-30 08:45:45 +02:00
agh1467
5cb6a89503
MVC - bootgrid - regression from 79f5d8f (#5840)
* Exclude if array, primarily for rowCount
2022-06-30 08:28:30 +02:00
Franco Fichtner
5121b8a6d4 interfaces: fix truncation of IPv6 addresses and consistency for PTR 2022-06-30 08:12:16 +02:00
Ad Schellevis
f159f68f97 Interfaces: Diagnostics: DNS Lookup - replace with MVC version. 2022-06-29 21:32:50 +02:00
Franco Fichtner
7eadf5f447 openvpn: hardcode the RFC 7919 DH parameter #4722
This allows us to remove all DH handling remnants.  If people
want to use a separate content they will have to let us know,
but it seems unlikely.  The only impact seems to be a security
bump from 2k to 4k default.
2022-06-29 20:04:07 +02:00
Ad Schellevis
ee81d4adfd MVC - add support for non persistent (in memory) models. (2)
type issue in comparison
2022-06-28 19:51:04 +02:00
Ad Schellevis
15881b1829 MVC - add support for non persistent (in memory) models.
In some cases its practical to use the validation framework without the storage option, for example when it comes to writing diagnostics modules which require validated user input.
This commit adds the :memory: mountpoint which prevents storage to the config.xml and keeps data inside the model object only.
2022-06-28 18:58:15 +02:00
Ad Schellevis
79f5d8f3fa MVC / bootgrid - merge option objects in stead of replacing them. closes https://github.com/opnsense/core/pull/5833 2022-06-28 16:29:08 +02:00
Ad Schellevis
690372b54a Firewall: Aliases - internal aliases can't be disabled. closes https://github.com/opnsense/core/pull/5834 2022-06-28 16:21:39 +02:00
kulikov-a
5ae3f8e2f6
add filter (#5305) 2022-06-28 14:34:03 +02:00
Franco Fichtner
1ca149fdcc dhcp: remove ddnsupdate static mapping switch
From a top-down perspective it only makes sense if ddns is enabled
globally, but in this case someone went copy+paste a bit too much.

Since now we force ddns-hostname from global state it makes sense
to tie the static override to this as well instead of making a sub-
switch for global functionality for an optional field to smoothen
the expected result.

If this override is actually useful is another question entirely.
2022-06-28 14:21:07 +02:00
rfc4711
37eae60b22 dhcp: inlcude ddns-hostname and other cleanups; closes #4452 2022-06-28 14:20:27 +02:00
Franco Fichtner
2006ead955 interfaces: small updates on previous 2022-06-28 13:40:14 +02:00
Manuel Faux
06fa8c7d2e
Wireless: Add WPA Enterprise Configuration for Infrastructure Mode (#4566)
* Wireless: Add EAP support for infrastructure mode

Add configuration for WPA2 Enterprise authentication for Wireless
infrastructure mode:

* EAP modes TLS, TTLS and PEAP
* Phase 2 modes MD5 and MSCHAPv2
* CA certificate for server verification
* Certificate for client authentication

* Wireless: dynamically show/hide relevant properties

For wireless interface configuration show/hide only currently
relevant settings to facilitate configuration.

* Show WEP settings only when WEP is enabled
* Show WPA settings only when WPA is enabled
* Show EAP settings only when EAP is enabled
* Show IEEE 802.1X settings only when relevant
* Hide AP-only/Adhoc-only settings when infrastructure mode
  is selected
2022-06-28 13:12:25 +02:00
Franco Fichtner
be50228e5c ipsec: style sweep 2022-06-28 11:16:41 +02:00
NOYB
79f8168b37
Firewall Log Widget Header Tweak (#5462)
Reduce line wrap:
Remove "Dest " from the destination port header.  Provides little value at the expense of increase line wrap.  In this context and column position (to right of destination address) it is obvious to be the destination port.  Source port in this context and column position would make no sense.
2022-06-28 11:16:01 +02:00
Franco Fichtner
d09fd3cce5 ipsec: cleanup for previous 2022-06-28 11:10:49 +02:00
vnxme
6d3bd41ab0
VPN / IPsec / Tunnel Settings: Add IPv4+6 protocol for mobile phase1 entries (#5436)
* VPN / IPsec / Tunnel Settings: Add IPv4+6 protocol for mobile phase1 entries
2022-06-28 11:10:34 +02:00
agh1467
59c2059eb2
MVC - model: throw when no mount found (#5830)
* Return a useful message to the UI if no mount is found in the model XML.
  Otherwise this condition results in a SimpleXMLElement error, trying to
  parse an empty string in toXml(), `$xml = new SimpleXMLElement($xml_root_node);`
2022-06-26 16:49:09 +02:00
agh1467
a3a54623a8
ui: bootgrid, correct required api for command-info #5478 (#5829)
* command-info uses this.command_info method, which expects
  params['info'] to be populated, not 'get'.
2022-06-25 22:02:39 +02:00
Franco Fichtner
91b840d5d2 interfaces: inconsistencies in wireless handling #5825 2022-06-24 13:17:02 +02:00
Franco Fichtner
09ff74b774 dpinger: prefer primary IPv6 to fix #5824 2022-06-24 08:26:03 +02:00
Franco Fichtner
7fdc163bf2 interfaces: style sweep 2022-06-20 11:51:18 +02:00
Franco Fichtner
d4a65e26e1 ui: boostrap-select ignored header height
Make sure selectpicker doesn't expand up underneath
the header making the first item not selectible under
certain conditions during expansion (scroll at 0).
2022-06-20 11:42:39 +02:00
Franco Fichtner
3c8efbc5f6 interfaces: typo in previous #5637 2022-06-17 09:32:09 +02:00
Franco Fichtner
2862eaf0cc interfaces: for specific device edit pages avoid reloading device again #5637
The device reconfigure is done unconditionally before configuring the attached
interface.  If we use reload we will configure the interface again, but if the
interface is disabled we wouldn't trigger the device creation.  So go back to
the former code which didn't exhibit any real issue before we used $reload.
2022-06-17 09:29:23 +02:00
Franco Fichtner
7aecb367c8 interfaces: upon reload request also generate the $realhwif; closes #5819
This goes for all "known" devices.  We need to be careful of reload loops
that create a device and then reload it which could trigger another interface
configure, but at the moment at least all $reload consumers are outside of
the plugin device code / single action driggers.

Also see: 90f471cb19
2022-06-17 09:24:43 +02:00
Franco Fichtner
82b11d3b5f interfaces: fix most common undefined access messages
ipaddr(v6) is not set when not configured which makes sense
but PHP wants us to acknowlege that we really want nothing
when the value doesn't exist.  Stuffing it through the parse_config()
was another idea but in practice in legacy code null equals
<sometag/> and '' equals <sometag></sometag> so if we prime both
fields using null we write them back as empty which isn't bad per
se but also best avoided.
2022-06-16 14:55:07 +02:00
Franco Fichtner
26ef1b0438 system: fix syntax error
Non-debug mode doesn't print "php -l" errors anymore.  Need to adjust to this.
2022-06-16 13:55:10 +02:00
Franco Fichtner
f5327b755a system: reduce $pwread scope to stop PHP from being silly
On failure of "pw" command the explode would split
"pw: no such user `foobar'" and then later check it.
If the user name was "pw" that would be suboptimal
for eligbility.

Instead ignore stderr and do not fill $userattrs which
is already handled by the if below but make it more
explicit using === null comparision.
2022-06-16 13:44:20 +02:00
Franco Fichtner
2d2b025a5f dhcp: fix weirdness in prefix crawler
PHP complains about unknown access, but the script is
even weirder with unused $active, storing null values
etc.
2022-06-16 13:23:01 +02:00
Franco Fichtner
23894aa370 system: link-local check using empty() to avoid warning 2022-06-15 07:55:58 +02:00
Franco Fichtner
bec615f6f7 system: possible undefined read 2022-06-15 07:50:54 +02:00
Franco Fichtner
90f471cb19 interfaces: remove /var/run/booting side effect #5637
interfaces_configure() is unaffected.  While looking at the code
decided to make all callers except newwanip and vxlan hook use
$reload to request a full reconfiguration as that is most likely
what the user would expect in these cases in the first place.
2022-06-14 14:20:12 +02:00
Franco Fichtner
d8553a0e7f firewall: allow NPT logging; closes #5228
We will be adding NPT logging support because the infrastructure
already supports it.  1:1 is a bit harder to deal with so hands
off for now and see how this works out.
2022-06-14 13:43:46 +02:00
Franco Fichtner
22e376a9a8 ui: remove IE workarounds; closes #5351
Some libraries may still hold compatible JS code but we will update
these as we come to work on them or they are in need of updates.
2022-06-14 12:43:24 +02:00
Franco Fichtner
b724e2e434 firmware: disable crash reporter submission on non-production deployment
Just fiddling with the soon to be replaced functionality.  Remove the
pedantic check so we can see everything even from the dashboard hint.
2022-06-10 14:35:05 +02:00
Franco Fichtner
0819c4232b system: handle "production" mode without introducing a new type
Store debug and deployment and keep production as the implied default
if we want to change this later we can't get out of it without a migration
which we don't have for legacy configuration storage at the moment.
2022-06-10 14:05:49 +02:00
Franco Fichtner
3a5484dcd5 system: if no temperature sysctls are exposed do nothing
Likely cause for syntax error in user report.

PR: https://forum.opnsense.org/index.php?topic=28684.0
2022-06-10 13:50:01 +02:00
Franco Fichtner
552f86f9ea dhcp: small cleanup for previous 2022-06-10 10:51:03 +02:00
Franco Fichtner
3f98dc83c4 dhcp: stop obsessing over bridges
It's really not nice to fudge a link-local in dhcp code as the
bridge has a separate setting for it since 2019.

While here remove the restriction for bridge members on relay
that seems to originate from m0n0wall and abandoned by pfSense
in 2020.
2022-06-10 10:42:24 +02:00