13838 Commits

Author SHA1 Message Date
Franco Fichtner
bf3f7ddfa9 src: style sweep 2022-03-22 13:51:40 +01:00
Franco Fichtner
9dfafbc2ec src: lint pass 2022-03-22 13:40:28 +01:00
Stephan de Wit
6832fd75a0
unbound: implement custom forwarders over current dot setup (#5606)
This PR pulls query forwarding over the current dot setup, so visually nothing changes.

All API calls are redirected to new Forward functions, which slightly modifies what is returned based on whether "Query Forwarding" or "DNS over TLS" is selected from the menu. This way backwards compatibility is preserved.

As an addition, a user is now able to specify a specific domain for a forward zone as well. Meaning that queries for this specific domain will skip a catch-all (".") domain (if specified), and instead use the server specified for this domain.

Entering a forward zone with a catch-all domain (".") in both Query Forwading and DNS over TLS is considered a duplicate by Unbound, so a static warning for this has been attached in the grid - however, it might be possible for a user to be warned dynamically over this.
2022-03-22 13:38:26 +01:00
Franco Fichtner
5205dd9da7 make: create dir before mfc 2022-03-22 11:20:01 +01:00
Franco Fichtner
57017c07f8 src: style sweep 2022-03-22 08:07:44 +01:00
Franco Fichtner
20ae548f62 interfaces: more PPP changes for ifctl ##5565 2022-03-22 08:02:33 +01:00
Franco Fichtner
46fe3ac65d interfaces: easier to read/compare this way 2022-03-22 07:47:15 +01:00
Ad Schellevis
28e7d49380 configd - change error level for "unable to sendback response" messages as these aren't errors, just a reminder the client is too slow to wait for the answer. closes https://github.com/opnsense/core/issues/5639 2022-03-21 20:14:31 +01:00
Franco Fichtner
657265a410 interfaces: protect filter configure script #5637
Detach the OpenVPN filter reload a little so we make sure it only
executes once if the reconfigure all.  Not sure if these are strictly
neeeded but better to keep them now.
2022-03-21 11:07:55 +01:00
Franco Fichtner
9a0a4abe90 reporting: extract /var/run/booting use from RRD #5637
We can instruct the boot sequence to tell the function and lose the
need to check the flag.
2022-03-21 10:51:50 +01:00
Franco Fichtner
77594c8b99 firewall: route-to, reply-to (and dup-to) are mutally exclusive
PR: https://forum.opnsense.org/index.php?topic=26700.0
2022-03-21 10:19:16 +01:00
Franco Fichtner
61500f6790 interfaces: suspicious code is suspicious
I'm not sure why interface_bring_down() is needed when both
IPv4 and IPV6 are empty.  It sort of means "handle this the
hard way when doing tunnel configurations" althoug the code
disagrees about the historic comment and the code that was
introduced... "set to none" vs. "ipaddr <> none" and later
"empty(ipaddr)" to match the comment.  In the grand scheme of
things this does not matter at all...

So in 22.1.3 we removed the inline configuration of GIF and GRE
which causes interface configuration to strip the addresses
added by device configuration instead of refixing it on the
fly (executing code twice all the time).  The code flow was
always correct but in practice tripping over itself so now try
a more sensible approach by stripping addresses when we have
assignments going on individually for IPv4 and IPv6.

PR: https://forum.opnsense.org/index.php?topic=27553.0
2022-03-21 09:34:34 +01:00
Franco Fichtner
f58789d1e8 interfaces: log the reload hook
Under normal circumstances a tunnel that is assigned to an
interface will be restarted when said interface becimes
available.  This is to fix the previous load of the device
when the actual interface wasn't yet ready.
2022-03-21 08:40:30 +01:00
Franco Fichtner
9a618ba689 interfaces: loopback "lo0" exists for VIPs
Historic oversight of wedging in a loopback interface in virtual IP
section while not making sure the actual configuration receives a
virtual IP when it needs to.  This was previously fixed by a batch
VIP regeneration in interfaces_configure() but we already saw that
this is not needed in 99% of the cases.

PR: https://forum.opnsense.org/index.php?topic=27547.0
2022-03-19 20:10:41 +01:00
Ad Schellevis
0ac674ceac Firewall - Aliases : tighten fqdn validation to avoid mistypes as 192.168.01.1 from being accepted as domain name. 2022-03-18 17:26:21 +01:00
Franco Fichtner
56bd1c33c2 interfaces: add manual page for ifctl; closes #5631 2022-03-18 09:28:44 +01:00
Franco Fichtner
cea2768c71 system: document configctl in a manual page #5631 2022-03-18 09:00:17 +01:00
Franco Fichtner
96039560ad interfaces: detach newwanip call as discussed 2022-03-18 08:28:04 +01:00
Franco Fichtner
975b38c065 system: shorten markers, drop "growfs" suffix 2022-03-17 07:58:19 +01:00
Ad Schellevis
64227e7cb0 newwanipv6 - revert ipv6 from 8c49c7bfdd as discussed 2022-03-16 21:23:59 +01:00
Ad Schellevis
797c186419 dhclient-script: prevent the removal of default routes as rc.newwanip is responsible for calculating the correct active default.
Ideally rc.newwanip should be as lightweight as possible, with 8c49c7bfdd in place normal execution doesn't take much time, but it likely doesn't make sense to hook gif|gre interfaces either when nothing has changed.

closes https://github.com/opnsense/core/issues/5624
2022-03-16 20:44:37 +01:00
Ad Schellevis
8c49c7bfdd rc.newwanip[v6] - only reconfigure an interface if it's either a non static non dhcp[6] variant or the address has changed.
It might be possible to skip the whole !is_ipaddr(), but the side affects aren't fully clear hence the != dhcp[6] to ease implementation.
Before this commit, dhcp[6] interfaces always tried to reconfigure, which makes the whole comparison quite useless.

related to https://github.com/opnsense/core/issues/5624
2022-03-16 20:16:35 +01:00
Franco Fichtner
10e6759ab6 system: another typo during review 2022-03-16 14:07:58 +01:00
Franco Fichtner
ca73304d6a firmware: minor issue here 2022-03-16 13:59:21 +01:00
Franco Fichtner
c3e0a8c61f console: return value not returned 2022-03-14 10:01:14 +01:00
Franco Fichtner
b07d403b9f interfaces: ifctl now lists available files for -i use 2022-03-14 08:56:57 +01:00
Franco Fichtner
c39ef68e58 interfaces: add ifctl -r and -p for router and prefix files
We add this here to ensure consistency between the functionalities
of these interface helper files.  Not all instances have been
converted, but they can be as time permits.  Tested on IPv6.

While here settle on "prefix" for pdinfo as a thing since we
renamed it already anyway.
2022-03-11 15:39:45 +01:00
Franco Fichtner
2d040c8968 system: configctl now a link like ifctl
So we should finally build manual pages for ifctl and configctl.  ;)
2022-03-11 12:10:57 +01:00
Franco Fichtner
d4f4b48b06 system: prefer address family earlier on boot
Looking for things that could go wrong with root.key in Unbound
this could be one of those.  Still, at this point we may not have
received DNS servers from the ISP since these are registered much
later (10-newwanip).

Great opportunity to ditch prefer_ipv4_or_ipv6() since we need it
for resolving which we set up alongside and in the right spot.
2022-03-11 11:18:04 +01:00
Franco Fichtner
6446a4ccfa interfaces: ifctl link for nameserver.sh
Not sure about nameserver.sh name and scope yet so try to
hide it under a link.  We can always change the name later
although having .sh suffix helps us lint the script more easily.
2022-03-11 10:50:04 +01:00
Franco Fichtner
321f3101d9 system: configd_ctl.py should be same as configctl
Historically both make sense but nothing calls configd_ctl.py
directly anymore so we can either leave it at that or merge
the code and behaviour into configctl.  (Or better yet set a
symlink to configctl).
2022-03-11 10:31:59 +01:00
Franco Fichtner
e6d2cbef47 interfaces: same for lagg here 2022-03-11 10:11:50 +01:00
Franco Fichtner
bc7a646aef interfaces: "_" prefix means only call internally
Also now we can grep for "interfaces_vlan_configure" to see both
and "interfaces" is the actual prefix to be used from interfaces.inc.

Later we should try to avoid calling "_" prefix functions from code
not in interfaces.inc.
2022-03-11 09:09:54 +01:00
Franco Fichtner
c474bb3e62 Revert "interfaces: issues with assigned gif/gre tunnels #5540"
This reverts commit a7b446f6d3e676cd5b94aa916ceefdf631facbfc.

Overly cautious:  the code still handles this by reloading a
GIF/GRE/bridge internally.
2022-03-11 08:48:56 +01:00
Franco Fichtner
a7b446f6d3 interfaces: issues with assigned gif/gre tunnels #5540
We still need this code because the current logic of resolving
dependencies is flawed.  At least we do not start GIF/GRE more
than twice now.
2022-03-11 08:14:07 +01:00
Franco Fichtner
b5619fef39 pkg: after having dnspython break our initial 21.7.8 builds
Now we circle back from dnspython2 to dnspython "just because".
This is too tedious to even complain about.  All it does is
wreck opnsense-revert usage... congrats to all involved.
2022-03-10 19:50:49 +01:00
Franco Fichtner
3cdfbfac26 interfaces: fix typos and tweak after testing 2022-03-10 09:49:19 +01:00
Franco Fichtner
b9bca80d6d interfaces: clean up this portion
Cite the manual page on the MTU requirement of (additional) interfaces.
This isn't the first time we add to a bridge since we make sure that
both interfaces exist which can only happen at the end of the boot sequence.

Speed up the reading of ifconfig values by only obtaining it once.
2022-03-10 09:34:05 +01:00
Franco Fichtner
68454bd30c src: style sweep 2022-03-10 08:38:04 +01:00
Franco Fichtner
e00a9a2031 dhcp: use opnsense-log -n for prefix reads 2022-03-10 08:32:17 +01:00
Franco Fichtner
32fe53a228 system: try to hide "latest.log" magic in this utility 2022-03-09 11:00:19 +01:00
Ad Schellevis
71a8da452c DHCPDv6: stream read log and leases files for "dhcpd update prefixes" action, see https://forum.opnsense.org/index.php?topic=27319.msg132541#msg132541 2022-03-04 19:42:48 +01:00
Ad Schellevis
c5c1ed9121 Filter - rules: constrain default carp allow rules to those defined in rfc5798, closes https://github.com/opnsense/core/issues/5613 2022-03-03 16:07:15 +01:00
Franco Fichtner
f064082abc ipsec: fix mobile switch logic
PR: https://forum.opnsense.org/index.php?topic=27291.0
2022-03-03 08:11:10 +01:00
Franco Fichtner
901523cb01 interfaces: special gif handling for MTU is long gone
According to history at one point around 2011 FreeBSD removed
a special feature from GIF being able to attach to a bridge
with a lower MTU but althoug those times are long gone and
efforts to retain a patch in project history have made this
silly code stick around for over a decade when the better half
of this decade this didn't work and also nobody reported it.
2022-03-02 14:41:29 +01:00
Franco Fichtner
6dc225f564 src: style sweep 2022-03-02 14:27:26 +01:00
Ad Schellevis
99aacf7326
Interfaces: Other Types: VLAN - Add stacked VLAN support (IEEE 802.1ad / QinQ) (#5607)
* Interfaces: Other Types: VLAN - Add stacked VLAN support (IEEE 802.1ad / QinQ) for https://github.com/opnsense/core/issues/5560

This commit adds QinQ to the new VLAN MVC implementation.

o Implement new interface nameing, vlan_XXX for vlans and qinq_XXX for QinQ interfaces, to keep the names static its much easier to cope with changes.
o For backwards compatibilty keep existing interface naming for old entries.
o interfaces_vlan_configure() is only called during bootup and should enforce proper ordering in device creation (vlans first stacked later)
o interface_vlan_configure() remove pcp tricker around 0 as the model will enforce zero's anyway
o lock vlan when being used in QinQ interfaces
2022-03-02 13:55:23 +01:00
Franco Fichtner
21643101eb interfaces: annotate device dependency issue #5540
The scope for this is larger (VLAN/QinQ/LAGG) so here we just try
to raise awareness for future refactor if other device types.
2022-03-02 11:00:06 +01:00
Franco Fichtner
94db2d45eb make: softcode the use of branches to ease backporting 2022-03-02 10:48:28 +01:00
Franco Fichtner
1bec5fad0f firmware: update work in progress for upgrade handling
We can now safely check packages kernel and base set version from
opnsense-update.  The basic idea is still that a packages set marker
is included now so we can refrain from updating packages once we
are crossing over a major version barrier using said packages set.
2022-03-02 09:30:03 +01:00