Skip to content

ffbs-mesh-vpn-parker: send the captive portal URI of the config service - #73

Open
awlx wants to merge 2 commits into
parker-release-2026.11from
awlx-parker-captive-portal-option
Open

awlx wants to merge 2 commits into
parker-release-2026.11from
awlx-parker-captive-portal-option

Conversation

@awlx

@awlx awlx commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 502af33468191ebad13fc4bdebef2a8d8d4abb95

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ Lab: the client capture shows option 114 in OFFER and ACK, and RA option 37. Change, removal and invalid values also work.
↓ RA option 37 needs freifunkMUC/uradvd#2 and freifunkMUC/site-ffm#1035 (both open).
↑ Unit test, luacheck and shellcheck are clean.
↓ Not tested on real hardware or with real RFC 8925 clients.
↓ CI not yet inspected.

Summary

The old central DHCP server sent a captive portal URI to the clients in DHCPv4 option 114 (RFC 8910). With Parker, each node runs its own dnsmasq, so this function was lost.

This PR brings it back. The config service (broker) gives the URI:

  • nodeconfig.sh sends the Gluon domain of the node: &domain=<gluon.core.domain>. It sends the value only if it matches ^[a-z0-9_-]{1,64}$.
  • noderoute.lua reads the optional field captive_portal_url and sets option 114 for the client network in dnsmasq.
  • parker/dhcp.lua checks the value: https only, at most 255 bytes, no comma, space, quote or #. The node ignores an invalid value and logs it.
  • If the field is missing or invalid, the node removes the option.
  • RA option 37 (RFC 8910), second commit: noderoute.lua writes the URI to /tmp/captive_portal and restarts uradvd when the value changes. Without a URI, it removes the file. The Gluon radvd arguments pass the file to uradvd --captive-portal. This needs feat: Implement --captive-portal (RFC 8910) uradvd#2 and parker: announce the captive portal in RAs (RFC 8910) site-ffm#1035. Without those, the file has no effect.
  • README: the request line and the optional fields table are updated.

Broker side: freifunkMUC/wgkex#341.

Compatibility

  • The field is optional. If a config service does not send it, the node does not change its DHCP options. This keeps compatibility with Freifunk Braunschweig.
  • The only new item in the request is the domain query parameter. A config service that does not know it ignores it.

Tests

Commands:

cd ffbs-mesh-vpn-parker
lua tests/captive-portal-test.lua
luajit tests/captive-portal-test.lua
luacheck luasrc
shellcheck files/usr/sbin/nodeconfig.sh

Results:

  • Both test runs print ok.
  • luacheck: 0 warnings. shellcheck: no findings.

Test cases: a valid URI is accepted. http://, a comma, a space, a quote, #, a newline, more than 255 bytes and a non-string are rejected. merge_option adds, replaces and removes option 114 and keeps the other options.

Lab (isolated lab, no production systems; node u1 runs v2026.11.1-parker8+cp1f917dd-lab; the lab config service has the same map logic as the broker):

Test Result
CP-1: the node sends domain=ffmuc and gets the URI. dnsmasq has dhcp-option=client,114,https://ffmuc.net/captive. PASS
CP-2: client capture. OFFER and ACK have URL (114), length 25: "https://ffmuc.net/captive". dnsmasq sends it as a string. PASS
CP-3: with 464XLAT, OFFER and ACK have option 108 (= 0) and option 114. PASS (on the wire)
CP-4: the URI is removed from the config. The node logs No longer announcing a captive portal. The client ACK has no option 114. PASS
CP-5: an http:// URI or a URI with a comma. The node logs Ignoring invalid captive_portal_url and sends no option 114. PASS
CP-6: old parker8 firmware gets the field. It ignores it and applies the config. PASS

RA option 37 (node u1 runs v2026.11.1-parker8+cp502af33-ra37-lab, with uradvd daae278 and freifunkMUC/site-ffm#1035):

Test Result
RA37-1: no URI RA has no option 37. No /tmp/captive_portal. PASS
RA37-2: URI set uradvd --captive-portal https://ffmuc.net/captive. RA option 37 has the URI. DHCP ACK option 114 has the same URI. PASS
RA37-3: URI changed uradvd restarted within 60 s. RA has the new URI. PASS
RA37-4: URI removed File removed. No RA has option 37. No option 114. PASS
RA37-5: single-site node (gluon-radvd) Option 37 present, then gone after removal. PASS

Not tested:

  • Real hardware. Production. No live test.
  • Real RFC 8925 clients (Android, iOS, macOS). They stop at the OFFER when they get option 108, so they may not use option 114. RA option 37 is for these clients. No real client was tested with it.

Thanks to Freifunk Dillingen/Donau for the report.

awlx added 2 commits November 24, 2026 14:39
The config service can send an optional captive_portal_url. The node
sends it to its clients in DHCPv4 option 114 (RFC 8910). Without the
field, the node sends no option 114 and removes an old one.

nodeconfig.sh sends the Gluon domain of the node, so that the config
service can select a URI for each domain.
noderoute writes captive_portal_url of the config service to
/tmp/captive_portal and restarts uradvd when the value changes. The
Gluon radvd arguments pass the file to uradvd --captive-portal, which
sends RA option 37 (RFC 8910). Without the field, noderoute removes the
file and the RA does not change.
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