net/tayga: don't accept a netmask in the address fields - #5705
Open
Lux-WorldPC wants to merge 1 commit into
Open
net/tayga: don't accept a netmask in the address fields#5705Lux-WorldPC wants to merge 1 commit into
Lux-WorldPC wants to merge 1 commit into
Conversation
The four address fields allow a cidr suffix, but nothing downstream takes one: rc.d appends its own mask, so ifconfig gets 192.168.254.1/24/32 and rejects it, and tayga.conf wants a bare ipv4-addr and ipv6-addr, so the daemon exits before the interface exists. Save and Apply both report success either way. Closes opnsense#5594 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important notices
Before you submit a pull request, we ask you kindly to acknowledge the following:
If AI was used, please disclose:
on a real installation, against the endpoints the settings page itself posts to
(
/api/tayga/general/setand/api/tayga/service/reconfigure), and I reviewed each one beforeposting.
Describe the problem
The four address fields are
NetworkFieldwithoutNetMaskAllowed, so a CIDR suffix passesvalidation. Nothing downstream accepts one:
rc.d/opnsense-taygaappends its own mask, andtayga.conftakesipv4-addrandipv6-addras bare addresses.v6destinationandv4destinationreachifconfigas${value}/128and${value}/32. Enteringfd00:6464::1/126in the IPv6 NAT64 Interface Address givesifconfig: fd00:6464::1/126: bad value,no
inet6on the interface andnd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>— the statereported in the issue.
192.168.254.1/24in the IPv4 field behaves the same way and leaves noinet.v4addressandv6addressgo intotayga.conf, where the daemon rejects its own configuration —Expected an IPv6 address but found "fd00:6464::2/126" on line 8— and exits 1. Started from the rcscript it prints nothing at all, so what the user gets is
ifconfig: interface nat64 does not existthree times, the same from
route, and no interface.In all four cases Save returns
savedand Apply returnsstatus: ok, so nothing in the GUI saysthe address was not applied.
Measured on 26.1.11_10 / FreeBSD 14.3-RELEASE-p10, os-tayga 1.5, tayga 0.9.6, one field at a time
with the defaults restored between cases. The issue reports 26.7.1, which I do not have; the plugin
version is the same.
Describe the proposed solution
Set
NetMaskAllowedtoNon those four fields, and give them a validation message: the default oneoffers "a valid network segment or IP address", which is what the change now refuses. The wording is
the one already used in
sysutils/node_exporter.v6prefixandv4poolare untouched — those twodo take a network.
Each of the four inputs above is now refused against the right field with that message, while the
same addresses without a suffix save. None of the four refused forms works today — two leave the
address unset, two stop the daemon from starting — so no configuration that currently works becomes
invalid. An accepted configuration applies cleanly:
inetandinet6both present, noIFDISABLED,the daemon running and the routes added.
v6prefixat2001:db8:64::/96andv4poolat10.64.0.0/16still save and still work.The issue only reports the IPv6 interface address. I included the other three because they fail the
same way and would otherwise stay open; happy to narrow it to
v6destinationif you would rather.One limitation worth stating: this does not reach installations that already stored such a value.
performValidation()only validates fields that changed (BaseModel.php:637), so withfd00:6464::1/126inconfig.xmlI re-saved the page untouched and it passed, changed another fieldand it passed too; the message appears only once that field is edited. Such an installation is no
worse off either — the settings page still opens and the runtime behaviour is unchanged. The model's
treatment of the data is unchanged, so no migration and no model version bump.
PLUGIN_REVISIONleft alone.Related issue
Closes #5594