15327 Commits

Author SHA1 Message Date
Franco Fichtner
03519568aa interfaces: RENEW and REBIND report partial PDINFO #6583
Previously it was thought that RENEW/REBIND do not reload properly but
this was eventually about another bug for when the server returns "no
binding" message and subsequently fixed in dhcp6c but not yet released
up to 23.1.8.

Ignore PD RENEW/REBIND as it will be the same value as REQUEST anyway.
2023-05-29 13:52:43 +02:00
Franco Fichtner
cebd68b299 src: style sweep 2023-05-28 17:00:28 +02:00
Ad Schellevis
9c31412e46 System: Diagnostics: Services - fix minor bug in service control where 'id' field was being ignored (name --> id). While here, also remove an access space in the service controller 2023-05-28 16:02:33 +02:00
Franco Fichtner
07f07fff3b system: improve static routes error handling
3c7fb657e14dfc muted "delete" operations but also "add" which makes
it impossible to see failures like the latest regression fixed in
25e2c0a301e1.  Since system_default_route() handles this accordingly
use the same approach here.
2023-05-28 13:05:53 +02:00
Daniel Mason
25e2c0a301 Fix issue with route add command 2023-05-28 12:51:21 +02:00
Franco Fichtner
3166ac7eb2 backend: fix regression in defactor missing description
No jobs showed up in the cron GUI for development which was a
bit suspicious.  The old default seemed to be empty string so
keep that behaviour instead of setting "None".
2023-05-26 08:39:39 +02:00
Franco Fichtner
5d5e957941 interfaces: fix regression causing rc.linkup stop to disappear the link-local 2023-05-25 07:37:19 +02:00
Franco Fichtner
95315b5ee2 src: style sweep 2023-05-24 10:45:02 +02:00
Franco Fichtner
c586bdb1a5 system: allow "." DNS search domain override; closes #6529
While here refactor get_searchdomain() a little to avoid complexity
in system_resolvconf_generate().
2023-05-24 09:30:38 +02:00
Ad Schellevis
33667b8bea VPN: OpenvPN : Client Specific Overrides - regression in https://github.com/opnsense/core/issues/6381 missed new redirect-gateway implementation. 2023-05-23 17:01:02 +02:00
Franco Fichtner
eca82994c3 interfaces: make this shorter 2023-05-22 13:31:23 +02:00
Franco Fichtner
236a3a7e7f interfaces: the presentation of values and extraction isn't ideal as all overlaps
Simplify for now and revisit this later in MVC.
2023-05-22 13:13:30 +02:00
Franco Fichtner
e581f82e6e interfaces: fix parsing our cryptic devices names 2023-05-22 13:09:43 +02:00
Franco Fichtner
41e5d0b79f interfaces: fix origin of bad read
'track6' might be shown as IPv6 address.
2023-05-22 13:00:22 +02:00
Franco Fichtner
4d9b8f0f4e interfaces: status page minor fixes 2023-05-22 12:43:03 +02:00
Franco Fichtner
c12e77519f interfaces: do not flush nameserver routes we do not add
Cleanup would be better but ifctl is not the place for it (no symmetry).

Maybe in the future we can use output from

    # pluginctl -r host_routes

to remove the routes safelty as they don't show if not used.

PR: https://forum.opnsense.org/index.php?topic=33831.0
2023-05-22 08:34:19 +02:00
Franco Fichtner
92d14dd4cd interfaces: parse driver name from ifinfo, add pluginctl magic 2023-05-18 11:29:12 +02:00
Franco Fichtner
78940da396 interfaces: avoid null route on fragile /64 and fix typo
PR: https://forum.opnsense.org/index.php?topic=33999.0
2023-05-17 21:22:39 +02:00
Franco Fichtner
9a1adab6c8 src: style sweep 2023-05-17 21:08:47 +02:00
Ad Schellevis
4d0eb9d323 MVC/Config - change exclusive to shared lock as discussed in https://github.com/opnsense/core/issues/6565 (minor rework on bebf3a2a7c)
Also replace copy() with a locked version for restoreBackup().
2023-05-17 20:15:38 +02:00
Ad Schellevis
3a6c79d4bc MVC/Trust - Implement new Trust class usage for the following components:
o OpenVPN Client Export
o Captive portal
o Syslog-NG
2023-05-17 16:29:32 +02:00
Ad Schellevis
a78a9cf355 MVC/Trust - add wrapper around trust module for reusable functions. 2023-05-17 14:45:58 +02:00
Franco Fichtner
f696930bb3 system: fix and adjust a couple of things for #6231
Do not "leak" state transitions and also always log them to the
gateway log if they aren't being pushed through the rc.syshook
alarm path.  While here consolidate the logging into the script
and make 10-dpinger script a stub for the "monitor" facility.
2023-05-17 12:58:54 +02:00
Franco Fichtner
49a6b614a3 system: refine gateway watcher service behaviour
Allow a (re)start and make it the "main" service.
2023-05-17 10:57:22 +02:00
Franco Fichtner
b6c3ab45e7 system: fix warnings 2023-05-17 10:46:16 +02:00
Franco Fichtner
a73d032397 system: stop watcher if no instances are found
Symmetry with service definitions.
2023-05-17 10:40:33 +02:00
Franco Fichtner
a2bc2705ea system: move gateway monitor trigger to separate script #6231
1. The process runs forever to retain proper state, periodically
   syncing the configuration data in order to react correctly.
2. Missing gateways are not an issue.  They will not alert or stick
   to their last verified value.
3. We stop reacting unless a default gatway switch action will follow
   or the gateway is part of a gateway group.  Triggers are not refined
   for now so we just let it run in full processing if a candidate.
4. Emulate the strange monitor alarm output although I don't see the
   use for all of this cryptic goo.  The alarm state (0, 1) was changed
   to reflect the observed transition causing the alarm script to run.
5. Move the action for the script alarm to the script itself.  Requires
   a bit of backend shuffling as well.
6. Only create one script to watch all monitors.  Easier to manage and
   to present as service (which can be stopped and started if needed).
2023-05-17 10:36:37 +02:00
Franco Fichtner
21f1ccda94 interfaces: add "autoconf" to details output
While adding noticed that it wasn't added which was due to
ending interation one cycle too early (last word on the line)
so changed the parsing to slightly.  Reaching forward with
certain keywords in place is safe, just need to make sure to
skip what we have read then.  Same for IPv4 although less
relevant.
2023-05-17 09:45:48 +02:00
Franco Fichtner
3e457864c7 interfaces: extend/modify IPv6 primary address behaviour
"primary" now works like its IPv4 counterpart not using tracking
interface addresses to suggest a different derived listening address.

OTOH "routed" and "scoped" variants are only relevant for services
listening on a particularly connected (functional) address.  Its use
is relatively low but better to have these variants than handroll each
required spot.
2023-05-17 09:29:51 +02:00
Franco Fichtner
227d092d23 system: make sure routing messages all use ROUTING prefix 2023-05-17 08:17:10 +02:00
Franco Fichtner
4fe0f4dc65 mvc: style sweep 2023-05-17 07:44:25 +02:00
Ad Schellevis
bebf3a2a7c MVC/Config - Prevent config restore when writer has flushed or partly wrtiten the file. closes https://github.com/opnsense/core/issues/6565
This should lower the chances of accidental restores when reader processes are active very frequently triggering a restore on a faulty read.
It should be possible to read the configuration while the config is exclusively locked, as these operations may take much more time than the actual write process takes.
After this commit the reader first tries to read unconditionally and if this fails, waits until a lock can be acquired.

To increase visibilty of restore invents, send these to the audit log in stead of the general system log.
2023-05-16 20:45:53 +02:00
Ad Schellevis
2da3787b38 MVC/BaseModel - format logger to avoid duplicate timestamps. 2023-05-16 20:06:03 +02:00
Franco Fichtner
aba6dfae93 interfaces: typo in previous 2023-05-16 15:12:04 +02:00
Franco Fichtner
bde52467de interfaces: do not reach for tracked interfaces during rc.newwanipv6
Shift away from get_interface_ip() as we don't need to handle VIPs or
plain addresses here and make sure that we do not reach for tracked
interface addresses.  This will make link-local end up as the current
IP being cached, but that's fine since previously we fixed the shifting
prefix detection during RENEW/REBIND and that looks to be working.

Eventually we need to rename "prefix" variant to "primary" as that is
what it is doing and the current "primary" one is more of a listen
IP helper in case the WAN does not have a routable address.  But deal
with that later to avoid overcomplicating the current patch.

PR: https://forum.opnsense.org/index.php?topic=26832.0
2023-05-16 13:33:51 +02:00
Franco Fichtner
766f1f0c5a interfaces: for static "Use IPv4 connectivity" bring up IPv6 routes as well
Looks like a regression from e420cc4aa718f since rc.newwanipv6 is not called
in a static setup and later we only deal with IPv4.

PR: https://forum.opnsense.org/index.php?topic=33864.0
2023-05-16 08:40:55 +02:00
Franco Fichtner
603a6801f1 system: allow "." search domain for #6529 2023-05-15 13:21:52 +02:00
Franco Fichtner
fe6e5298b3 interfaces: preg_match returns matches, not bool 2023-05-15 10:18:04 +02:00
Franco Fichtner
8beb293c53 pluginctl: add an ifconfig mode for easier debugging and later use
PR: https://forum.opnsense.org/index.php?topic=33864.0
2023-05-15 10:11:38 +02:00
Ad Schellevis
c568629c01 Services: Unbound DNS: Overrides - when called via GET, encode using URLSearchParams(). closes https://github.com/opnsense/core/issues/6561 2023-05-14 17:00:21 +02:00
Franco Fichtner
c1784ad1ad system: print warning for duplicated gateway name
PR: https://forum.opnsense.org/index.php?topic=33864.0
2023-05-12 09:07:18 +02:00
Franco Fichtner
485bd39f13 interfaces: protect against INFOREQ in PDINFO force case #6522 2023-05-11 10:19:19 +02:00
Franco Fichtner
31961bf577 interfaces: handle RENEW/REBIND and PDINFO shift #6522 2023-05-11 09:57:53 +02:00
Franco Fichtner
26449b42d8 interfaces: print ignored reason regardless of debug state 2023-05-11 09:29:11 +02:00
Franco Fichtner
2db028d21b interfaces: report current IP for #6522 2023-05-11 08:40:16 +02:00
Ad Schellevis
d633cd961f MVC/Firewall/Util - add CIDRToMask() 2023-05-10 19:16:38 +02:00
Franco Fichtner
271525f00b pkg: these too 2023-05-10 16:56:23 +02:00
Franco Fichtner
db69027dda wizard: may end up duplicating WAN_GW which is bad
PR: https://forum.opnsense.org/index.php?topic=33864.0
2023-05-10 15:48:12 +02:00
Franco Fichtner
0a3ac8fb66 system: adjust for proper 'attribute' use in gateway edit 2023-05-10 15:22:20 +02:00
Franco Fichtner
eaa1894c66 system: looks like a typo 2023-05-10 14:48:15 +02:00