Skip to content

parker: AP controller package, client address only with 464XLAT, DHCPNAK fixes - #72

Open
awlx wants to merge 9 commits into
parker-release-2026.11from
awlx-parker-dhcp-ap-clientaddr-toggle
Open

awlx wants to merge 9 commits into
parker-release-2026.11from
awlx-parker-dhcp-ap-clientaddr-toggle

Conversation

@awlx

@awlx awlx commented Nov 23, 2026

Copy link
Copy Markdown
Member

Summary

This PR fixes the points that @grische found in the Parker review. Thank you, @grische, for the careful review.

Depends on

Commits

  • 43cb31d ffmuc-dhcp-ap-controllers: move the UniFi and Omada options out of parker (site-ffm#1014).
    The new package reads dhcp_ap_controllers.unifi4 and dhcp_ap_controllers.omada4 from site.conf. It removes the old uci section parker_unifi. ffbs-mesh-vpn-parker no longer has parker.unifi_controller4 and parker.omada_controllers4.
  • c49da72 ffbs-mesh-vpn-parker: move the client address only with 464XLAT (site-ffm#1015).
    The config service can give all nodes the same range4 only with 464XLAT, because the client IPv4 does not leave the node. Thus xlat_range6 in the node config is the switch. No new option is necessary. Without xlat_range6, the node uses address4 of the config service (the .1 address), as upstream.
  • bb5723c ffbs-mesh-vpn-parker: check for a used client address only with 464XLAT (site-ffm#1016).
    DHCPNAK after a gateway change and the 2 min lease stay on for all. The batman-adv check ("another node had this address in the last 60 s") runs only with xlat_range6. Without 464XLAT, the address belongs only to this node, and the node keeps it for the full 150 s.
  • 28792c9 ffmuc-cellular-wan-dns: remove cellular_6 (site-ffm#1013).
    Gluon removed cellular_6 (Fix cellular IPv6 DNS servers + related cleanup freifunk-gluon/gluon#3618), so the entry had no function. The DNS fallback stays: on OpenWrt 24.10, the qmi and mbim handlers still drop the DNS servers with peerdns 0 (fixed in newer OpenWrt by package: utils: remove dependence on peerdns to add dns servers openwrt/openwrt#21314).
  • 62256c3 ffbs-mesh-vpn-parker: do not set dhcp-authoritative in the DHCPNAK hold.
    An authoritative dnsmasq sends a DHCPNAK ("wrong server-ID") to a DHCPREQUEST in SELECTING state for another server (against RFC 2131 4.3.2). The old uplink then NAKed the new lease of a client from the new uplink. Small loss: a broadcast rebinding for a lease that dnsmasq does not know gets no DHCPNAK. Such a client waits until its 2 min lease ends.

Compatibility with ffbs

ffbs has no xlat_range6. Thus ffbs nodes use address4 from the config service and do no batctl dc checks, as upstream. The DHCPNAK hold and the 2 min lease are the same for all.

Changes needed in site.conf

Sites that used parker.unifi_controller4 or parker.omada_controllers4 must:

  • Move the values to dhcp_ap_controllers = { unifi4 = '...', omada4 = { '...' } }.
  • Add the package ffmuc-dhcp-ap-controllers.

Tests

Lab, image with community-packages 28792c9 (cp28792c9):

  • Part A (live lab nodes):
    • site-ffm#1014: clients get option 43 (UniFi, vendor class ubnt) and option 138 (Omada): PASS.
    • With xlat_range6, the client address moves on a conflict: PASS.
    • DHCPNAK hold of about 150 s, with a 2 min lease: PASS.
    • P9 failover regression: PASS.
  • Part B (isolated lab):
    • Single site, without 464XLAT, each node with its own range4: the node uses the .1 address and does not move it: PASS.
    • Multi-site without 464XLAT (site-ffm#1017): site failover gap of 3.5 s, and a correct switch back: PASS.

Lab re-test, image with community-packages 62256c3 (cp62256c3): 3/3 PASS.

  • "wrong server-ID" NAKs = 0, and renewals still get a DHCPNAK: PASS.
  • Hold without 464XLAT: 156 s: PASS.
  • Live hold with 464XLAT (tnak): 150 s: PASS.

Local:

  • tests/dhcp-authoritative-test.sh (dnsmasq 2.90, alpine 3.20, Docker): 17/17 PASS. With --dhcp-authoritative put back, the new SELECTING check fails, so the test finds the bug.
  • luajit on all ffbs-mesh-vpn-parker/tests/*.lua (with LUA_PATH="luasrc/usr/share/lua/?.lua;;"): all PASS. New: tests/dhcpnak-test.lua, and 3 checks in tests/noderoute-test.lua. The new checks fail on the old code.
  • ffmuc-dhcp-ap-controllers/tests/upgrade-test.lua: 6/6 PASS.
  • ffmuc-cellular-wan-dns/tests/update-test.lua: 13/13 PASS.
  • luacheck .: 0 warnings / 0 errors. shellcheck: no findings.

Not tested:

  • Production nodes.
  • Android clients (the emulators were stopped).

awlx added 9 commits November 23, 2026 09:26
parker/tunnels.lua now owns the handshake age limit and the
parker-sites status check. noderoute.lua makes its decision with it,
and noderoute.sh asks it for the set of usable tunnels while it waits.
The decision does not change.

tests/noderoute-test.lua runs noderoute.lua against a mock node.
Each step of apply_network() is now a function of its own:
configure_routing(), configure_client(), stop_other_radvd(),
reload_network(), update_dnsmasq(), update_pref64(), update_adv_mtu(),
update_radvd(), update_dhcp_options(), update_clat() and
wait_for_services(). The order of the steps and what they do do not
change.
Each noderoute cycle wrote about 16 log lines, also when nothing
changed. Now noderoute writes one "state:" line only when the
tunnels, the route, the addresses or the lease count change.
Transitions, warnings and errors are logged as before.

The routing decisions and the network actions do not change.
Put the small apply_network steps back into apply_network. Keep only
configure_routing and configure_client.

Log the state as one short line. Do not log handshake ages or the
default route. Keep the state line in a stable order, because
util.shuffle changes the tunnel list in place.

Make parker/tunnels.lua smaller. It has only active() and key().

Make the tests smaller. The action trace is the same as before.
…rker

The DHCPv4 options for UniFi and Omada access points do not need Parker.
Other communities can also use them.

Move them into the new package ffmuc-dhcp-ap-controllers. It reads
dhcp_ap_controllers.unifi4 and dhcp_ap_controllers.omada4 from site.conf.
It removes the old section parker_unifi of earlier firmware.

Remove the options, the site.conf keys parker.unifi_controller4 and
parker.omada_controllers4, and their documentation from
ffbs-mesh-vpn-parker.

Ref: freifunkMUC/site-ffm#1014
clientaddr moves the client address of a node away from other nodes.
This is only necessary when the config service gives all nodes the same
range4 and address4. That is only possible with 464XLAT, because then
the client IPv4 does not leave the node. Without 464XLAT, each node
routes its own range4, and no other node can use its address.

Use clientaddr only when the config has xlat_range6. Without it, the node
always uses address4 of the config service (usually the .1 address).
This is the upstream behaviour, and no new option is necessary.

Ref: freifunkMUC/site-ffm#1015
After a gateway change, the node keeps its old client address for 150 s
and sends a DHCPNAK to its old clients. The lease time is 2 min. These
parts help all communities and stay on.

The node does not keep the address when batman-adv has seen another
node with it. This check is only correct when all uplinks can have the
same address, thus only with 464XLAT. Without 464XLAT, each node has its
own range4, and the address belongs only to this node.

Do the check only when the config has xlat_range6. Without it, keep the
address for the full 150 s.

Ref: freifunkMUC/site-ffm#1016
Gluon removed the interface cellular_6 (freifunk-gluon/gluon#3618).
The interface is now cellular. Gluon adds cellular and cellular_4 to
interface.d of gluon-wan-dnsmasq. Thus the entry cellular_6 has no
function.

Remove the interface.d file and cellular_6 from the script and the
tests. Keep the fallback list: on OpenWrt 24.10, the qmi and mbim proto
handlers still drop the DNS servers when peerdns is 0.

Ref: freifunkMUC/site-ffm#1013
During the hold after a gateway change, the hold config made dnsmasq
authoritative. An authoritative dnsmasq sends a DHCPNAK ("wrong
server-ID") to a DHCPREQUEST in SELECTING state that names another
server. This is against RFC 2131 4.3.2. In the lab, the old uplink sent
a DHCPNAK to the clients that requested a lease from the new uplink.

Remove dhcp-authoritative from the hold config. The main dnsmasq is not
authoritative (905-dhcp-not-authoritative). dnsmasq still sends a
DHCPNAK to a renewal per unicast, and to a rebinding or INIT-REBOOT for
a lease in its lease file.

Small loss: a broadcast rebinding for a lease that dnsmasq does not know
gets no DHCPNAK. Such a client waits until its lease (2 min) ends.

Add test cases for SELECTING with the Server-ID of another server, and
for rebinding, INIT-REBOOT and renewal with a known lease.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant