port_forwarding: add source-zone selector for extra WAN VLANs#34
Merged
Merged
Conversation
basic.js's WAN VLAN table (PR #33) lets a router have more than one WAN zone (the default 'wan' plus 'wan_vlan<N>' zones for each additive VLAN row), but every port forward and open-port rule was still hardcoded to src='wan' -- there was no way to route a forward at a specific WAN VLAN (e.g. an ISP's IPTV/VoIP VLAN) rather than the primary connection. Each of the 4 rule tables (single/range forward, single/range open) now has a Source Zone column and a matching dropdown in its add/edit modal, populated from the firewall zones currently present (uciOriginal already has both firewall and network injected on this page, so no backend change was needed) -- 'wan' plus any 'wan_vlan<N>' zone, shown with its VLAN's own description when set. Zone is now part of a rule's identity for the multi-tab-safe save/reuse logic added in PR #27 -- buildRuleIndex()'s key gained the source zone, and every duplicate/overlap check (proofreadForward*/ proofreadOpen*) and TCP+UDP merge check became zone-aware, so the same external port can now legitimately be forwarded on two different WAN zones without being treated as a collision. Changing an existing rule's zone is treated as an identity change (old section retired, new one allocated), the same way toggling a rule's enabled/disabled state already was.
4 tasks
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.
Summary
Task #9 from the WAN VLAN Manager plan:
basic.js's WAN VLAN table (#33) lets a router have more than one WAN zone (defaultwanpluswan_vlan<N>for each additive VLAN row), but every port forward and open-port rule was still hardcoded tosrc='wan'-- there was no way to route a forward at a specific WAN VLAN (e.g. an ISP's separate IPTV or VoIP VLAN) instead of the primary connection.Changes
uciOriginal's existing firewall zones (wan+ anywan_vlan<N>zone) -- bothfirewallandnetworkare already injected into this page, so no backend/haserl change was needed. Each VLAN zone shows its own description (network.wan_vlan<N>.gargoyle_desc) when set, e.g. "IPTV (wan_vlan20)".buildRuleIndex()'s key gained the source zone, and every duplicate/overlap check (proofreadForward*/proofreadOpen*) plus the TCP+UDP merge check became zone-aware -- the same external port can now legitimately be forwarded on two different WAN zones without being flagged as a collision or silently merged into one row.Test plan
node --checkpassestests/known-devices/port-forwarding-zone.test.js(first jsdom harness for this page) -- 3/3 pass: an uneditedwan_vlan10rule emits zero commands; two rules sharing a port on different zones stay separate (no merge/collision); changing a rule's zone correctly retires the old section and allocates a new one with the updatedsrctests/known-devices/*.test.jssuite -- 50/61 pass, same 8 pre-existing unrelated failures with/without this change (tracked separately, PR wifi: allow independent encryption and password per AP band lantis1008/gargoyle#62/wifi: allow independent encryption and password per AP band lantis1008/gargoyle#68 not yet merged), 2 todo, 1 skipwan_vlan20zone plus two baseline forward rules (one per zone) via the realrun_commands.shendpoint; edited one zone's rule as "Tab A", edited the other zone's rule as a stale "Tab B" -- confirmed both edits landed with no cross-contamination and neither rule's zone was disturbed; added a 3rd rule reusing the same external port on the other zone and confirmed both coexist as separate sectionsvnet/tests/29-multitab_corruption.test.shT-MULTITAB-11 (companiongargoyle-toolscommit) -- full phase 29 suite now 11/11https://claude.ai/code/session_012xm1pavEAaQbR8Z5YoG8KX