4747 Commits

Author SHA1 Message Date
Franco Fichtner
d19cd6cdbf interfaces: get_interface_mac() not returning cached MAC result
Looks like this went unnoticed since 22.1.2.

PR: https://forum.opnsense.org/index.php?topic=29691.0
2022-08-04 23:39:46 +02:00
Franco Fichtner
83c1ce1b6f interfaces: fix warning 2022-08-04 22:39:39 +02:00
Franco Fichtner
d69ff4a16a interfaces: figure out point-to-point or subnet setup
PR: https://forum.opnsense.org/index.php?topic=29654.0
2022-08-04 22:25:56 +02:00
Franco Fichtner
e1e8abc03e rc: 750 for root fixup; closes #5475 2022-08-04 10:09:30 +02:00
Franco Fichtner
92cd0745e1 firewall: undefined key warning 2022-08-04 09:17:59 +02:00
Franco Fichtner
889420b652 interfaces: style update on GIF/GRE code
If we want to extend the feature here make room so we
don't have to deal with a single string concatenation.

Also disabled IPv6 inside GIF IPv4 tunnel.

PR: https://forum.opnsense.org/index.php?topic=29654.0
2022-08-04 08:53:14 +02:00
Franco Fichtner
9c6e5f0cfb dhcp: fix undefined key warnings 2022-08-04 08:51:54 +02:00
Franco Fichtner
abffe29b21 unbound: fix two undefined key warnings 2022-08-04 08:51:19 +02:00
Franco Fichtner
e76f15c357 system: refactor logic and populate hosts file a bit more
Already noticed that "ipsec" devices were throwing wrenches into
the engine here so try to match exactly on the pseudo-interface
names given by the GUI.
2022-08-03 09:06:20 +02:00
Franco Fichtner
b504bc8763 dhcp: extend search list pull from DHCPv6 and refactor #5919 2022-08-02 12:31:56 +02:00
Patrick M. Hausen
b319b1284f core/radvd - do not advertise DNS domain when DNS advertisments are disabled 2022-08-02 12:12:40 +02:00
Stephan de Wit
966e54011e
unbound: do not start DHCP watcher immediately after daemonizing unbound (#5920) 2022-08-02 10:33:59 +02:00
Stephan
2918f0e24e trust: use proper CRL id-ce-cRLReasons extension keyword 'unspecified' 2022-08-02 08:39:55 +02:00
Franco Fichtner
7aaa6a263b system: do not reload unbound/dnsmasq "hosts" by default
Number of people noted spurious restarts of Unbound and this seems
to be the cause.  However, the real cause of hammering rc.newwanip
is in 797c18641944 and to avoid other side effects like the GIF/GRE
stuff we should consider reverting part of it.
2022-08-02 08:22:26 +02:00
Franco Fichtner
8974c4661a dhcp: fix undefined key warning 2022-08-01 13:52:23 +02:00
Franco Fichtner
f9ea49ae31 interfaces: manual cache invalidate for previous
Purge the file on all known dynamic spots that run a deconfigure
of some sort.  We probably need something for a forced reload as
well but for now let's see if this works in general.
2022-08-01 13:45:18 +02:00
Franco Fichtner
97e7a93b7c interfaces: disable reload with same IPv6
rtsold resolvconf handing forces a lot of reloads now, something
also seen in rc.newwanip -- let's go the extra mile and lock the
cache IP in place until we do a full reconfigure.

We may have to build some sort of "expire" feature for the cached
IP since between forced reconnects we will want to reload again
anyway.  But not sure where that is as rc.linkup is unreliable as
it has been messing with this before.
2022-08-01 12:29:44 +02:00
Franco Fichtner
507ee2768f unbound: argument unused 2022-08-01 12:21:11 +02:00
Franco Fichtner
aa2bc6599e rc: remove _var_mfs remants #5917 2022-08-01 09:43:55 +02:00
Franco Fichtner
86ebdc291e interfaces: more issues with PHP 8 and uptime display #5910 2022-07-29 09:49:58 +02:00
Franco Fichtner
6ec65f7407 system: treat files with newlines #5900 2022-07-28 10:08:06 +02:00
Franco Fichtner
d7b3d61510 system: ensure that _defaultgw files are written #5900
Ok so this might have been an issue in the past WRT DHCP client
and default route hanling which is now done another way but maybe
it shouldn't have.  For now just see how this works in practice
and then decide later if more needs to be done or not.
2022-07-28 10:00:05 +02:00
Stephan de Wit
f8650c76aa
System Status: replace old notices system with a global one (#5875)
* MVC / System status: first draft for backend implementation

* fix copyright

* fix permissions

* MVC / System Status: modify backend implementation and setup front-end

* MVC / System Status: minor cleanup, ACL check and fix reporting in production mode

* MVC / System Status: copy status sytem to legacy as well, remove the notices system, finish up front-end work

* MVC / System Status: remove useless constructor

* fix plist

* System Status: shorten previous

* System Status: add ACL check

* System Status: also remove legacy part

* System Status: also clean up on legacy page

* System Status: ACL check on dismiss action as well

* System Status: add readonly privilege check to dismiss action

* System Status: do not trust input

* System Status: address security concerns

* add default return

* System Status: move js code to separate script and make sure a logLocation is always provided

* System Status: clean up callout in both legacy page and volt template

After dismissing a message and closing the dialog, the old message was still bound to the dialog instance. re-registering the onclick callback solves this.

* System Status: adjust log location and kick off status system on alias errors

* System Status: let's hold off on throwing notifications for aliases for now

* System Status: add ACL entry for the dismiss API call, adjust to new deployment situation

Without the ACL entry, /api/core/system/dismissStatus calls are rejected for non-root users even when they should have rights to dismiss.

Also do a minor consistency improvement and also adjust to the new situation of production & development deployment types. We need to account for the possibility of 'deployment' being empty in the configuration, therefore a direct check of the 'development' type seems most fitting as this is unlikely to change or be subjected to any additions.

* System Status: also error out when unable to write new rules

* System Status: account for users without permissions

* System Status: name collision in FirmwareController

* System Status: replace old notices system with a global one (https://github.com/opnsense/core/pull/5875)

Review feedback / modifications in this commit:

o filter.inc

-- remove wedged message, when locked during parallel reloads it likely doesn't help to disable/enable
-- flush message to error trigger file

o SystemStatus.php
-- str_contains --> strpos; eases testing on OPNsense 22.1.x as str_contains is php 8 only

o Status collectors
-- simplify logic and propagate messages received from status file

o CrashReporterStatus
- the existence of a /tmp/PHP_errors.log  file should be enough to know some process signaled the crash reporter
- remove shell exec

o FirewallStatus
-- as only /tmp/rules.error remains, remove loop to read for non existing files

o opnsense_status.js
-- add opn-status-group class to container and point css modifications in that single direction to prevent other objects from being affected by our status popup modifications
-- windows file endings replaced (^M)

o css:
keep menu_messages container to ease migration for theme developers

NOTE : ** get_crash_report() could likely be simplified as well

* filter: change to mwexec, redirection is implied

* System Status: handle potential undefined array key

seems to be a one-off error: Exception: Error at /usr/local/opnsense/mvc/app/controllers/OPNsense/Core/Api/SystemController.php:90 - Undefined array key 0 (errno=2) in /usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php:159

Co-authored-by: Ad Schellevis <ad@opnsense.org>
2022-07-28 09:50:06 +02:00
Franco Fichtner
9f0ba65615 interfaces: remove out-of-band _defaultgw file writes; closes #5900
IPv4 doesn't do this indicating that IPv6 shouldn't as well.
Also, ifctl is not handling this file either so we might as
well let system.inc deal with this.

PPPoE and DHCP still read the file but wouldn't consider this
a huge problem.

Also now makes sure the scope is added to link-local gateways,
which was a problem previously reported by @maurice-w.
2022-07-28 09:47:10 +02:00
Franco Fichtner
a5c02d8ade interfaces: migrate cleanup from interface_bring_down() #5862
Since we already kill routes in nameserver registrations we can
also take on the arp/pfctl magic moving the "router" file check
to its native utility.

It's debatable if we even need the pfctl or arp flush here.

To be continued...
2022-07-26 19:53:56 +02:00
Franco Fichtner
1fa0cb3e2d firmware: time for 23.1 development :) 2022-07-26 11:38:44 +02:00
Franco Fichtner
f8da0f2400 unbound: another undefined var 2022-07-25 13:29:58 +02:00
Franco Fichtner
6fe0cdd4b6 interfaces: replace router write with ifctl use #5862 2022-07-25 11:44:03 +02:00
Franco Fichtner
386b4679b4 openvpn: switch to ifctl use for #5862 2022-07-25 10:43:18 +02:00
Franco Fichtner
3c18be1086 interfaces: fix two warnings 2022-07-25 09:31:35 +02:00
Franco Fichtner
8db197ebe8 unbound: fix two undefined variable warnings 2022-07-25 09:31:11 +02:00
Franco Fichtner
a02b07a908 interfaces: add iwlwiwi to wireless devices
PR: https://forum.opnsense.org/index.php?topic=29435.0
2022-07-22 14:20:22 +02:00
Franco Fichtner
7135201700 firewall: call closelog() for symmetry
openlog() is already called elsewhere and some components changing
the log facility do the closelog() dance as well.
2022-07-22 13:40:10 +02:00
Franco Fichtner
90db8f4d0f interfaces: widen and improve ifctl use
We do want to eventually lean on exclusive ifctl use in order to
be able to improve logic in ifctl or make adjustments really easy in
the future without missing a spot (e.g. adding scope to link-local
routers).
2022-07-22 10:54:55 +02:00
Maurice Walker
d582435b4b interfaces: add support for SLAAC WAN interfaces w/o DHCPv6 #5862; closes #5883
New script to be invoked by rtsold when Router Advertisements with
RDNSS / DNSSL information are received. Uses ifctl to create the
/tmp/$if_routerv6 file and creates the /tmp/$if_defaultgwv6 file
directly. Fixes the issue that these files don't get created when
the M and O flags in RAs are not set. Also, passes RDNSS / DNSSL
info from RAs to ifctl.
2022-07-22 09:20:12 +02:00
Franco Fichtner
a7ec2175b1 system: move dpinger notification to right spot 2022-07-22 08:52:05 +02:00
Stephan de Wit
30f499e89e
Firewall: add general firewall log for alias and filter syslog messages (#5894) 2022-07-21 16:11:32 +02:00
Franco Fichtner
e9c57fd59b dhcp: note about staticarp behaviour 2022-07-21 13:52:30 +02:00
Franco Fichtner
216e489564 src: another one 2022-07-20 12:22:01 +02:00
Franco Fichtner
d44f9722e9 src: fix php deprecated warnings 2022-07-20 12:19:07 +02:00
Franco Fichtner
856574bbef dhcp: use a simple periodic update for now; closes #5876
Gets rid of package dependency which for dhcpleases6 simply
listens on the DHCPD lease file and runs the prefix.php command
unconditionally.

For now emulate this by issuing the command every 60 seconds
which can be adjusted later if someone complains, but seeing
how many bugs this script has had vs. how many people noticed
it (basically none) I doult this will have much impact overall.
2022-07-20 11:37:18 +02:00
Franco Fichtner
e58d7de7d4 system: improve wording as debug no longer exists #5889 2022-07-19 18:49:25 +02:00
Franco Fichtner
a256697cbf system: remove debug mode, disable display errors on runtime for development mode #5889 2022-07-19 16:47:00 +02:00
Franco Fichtner
0d77a46b1f ipsec: fix two warnings 2022-07-19 16:45:22 +02:00
Franco Fichtner
5fa042b687 dhcp: more work on #5847
Make sure to use a proper example from ISC dhcpd itself.
Here now we truncate the prefix and add the suffix, making
sure the suffix is correct.  If the upper 64 bits are empty
we likely have the wrong format and we shift it up as
e.g. "::2" is not a prefix range value, but "::2:0:0:0:0" is.

Note that this is in contrast to static IPv6 where this has
to be configured correctly in the first place.
2022-07-19 12:24:56 +02:00
Franco Fichtner
8d4b63d306 system: Net_IPv6::compress() should not compress "::" to "" 2022-07-19 11:26:31 +02:00
Franco Fichtner
b66ff4bc5b interfaces: fix expire dhcp6c regex further
According to the manual "forever" is actually the correct keyword.
Also the double-pipe was senseless matching an empty expression
and there was a dash missing between month and day.
2022-07-19 08:14:28 +02:00
Ad Schellevis
4e9baba4d0 System: Routes: Configuration - disable flag not removing static route. closes https://github.com/opnsense/core/issues/5887
looks like a regression in 52d3e7c676, after which delete doesn't seem to execute a valid route command.
2022-07-18 20:25:56 +02:00
Josh Soref
ed7c72ad30 system: fix "enforcement" spelling 2022-07-18 15:56:41 +02:00
Josh Soref
39246309c2 firmware: fix "scrubbing" spelling 2022-07-18 15:55:45 +02:00