feat(mdns): configurable skipInterfaces skip-list - #6
Conversation
On the BigFred hub the on-board WiFi radio is an exclusive, on-demand resource used only by wireless-programmer to associate to a device config AP (e.g. a NewHeiko WiFred) for the duration of a programming job. It never carries hub services, so advertising mDNS on it would leak bigfred.local / dcc-bus beacons onto a customer's device config network. Add wlan* to the hardcoded interface skip list (case-insensitive, matching the existing docker/veth/br-* convention). Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the hardcoded wlan* skip with a configurable skipInterfaces list on Config (JSON, default empty). The built-in docker/veth/br-*/cni/ flannel/virbr list is always applied; skipInterfaces adds extra case-insensitive name-prefix matches on top. By default wlan* is NOT skipped, so mDNS advertises on WiFi on a generic or laptop install. Operators who reserve the WiFi radio for another purpose (e.g. the BigFred hub, where wireless-programmer owns the radio) add ["wlan"] to skipInterfaces so mDNS does not leak bigfred.local / dcc-bus beacons onto a device config network. Threaded &[String] through should_skip_iface, preferred_ipv4_*, preferred_ipv6_addrs, preferred_iface_indexes, MdnsPublisher::register, and the AnswerSet/DesiredAds so the configured list flows from Config through run.rs and legacy_unicast.rs (and picks up hot-reloads). Co-authored-by: Cursor <cursoragent@cursor.com>
Review — configurable
|
- should_skip_iface no longer allocates: the name is already lowercased, so compare its head with eq_ignore_ascii_case instead of building a String per skip entry per interface on every poll. - refresh_memberships takes one read lock, so the addresses and the skip list come from the same generation of the AnswerSet. - The "no UP non-loopback IPv4" diagnostic names the configured skips. On a hub with skipInterfaces set and Ethernet unplugged this is the message an operator sees, and it previously hid the reason entirely. - Pin the JSON key: bigfred-os ships "skipInterfaces" and unknown fields are ignored, so a rename would silently turn the hub's opt-out into a no-op. - README: spell out that entries are name prefixes, since a short entry would take eth0/enp1s0 with it. Co-authored-by: Cursor <cursoragent@cursor.com>
Review points appliedPushed as
Left alone deliberately: |
Add "skipInterfaces": ["wlan"] to the hub's microdns config so mDNS does not advertise bigfred.local / dcc-bus beacons on the on-board WiFi radio. The radio is an exclusive, on-demand resource used only by wireless-programmer to associate to a device config AP; advertising on it would leak onto a customer's device config network. microdns defaults to an empty skipInterfaces list (so laptops advertise on WiFi), so the hub opts in explicitly. Requires microdns with the configurable skipInterfaces field (dcc-bigfred/microdns#6). Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
skipInterfaceslist toConfig(JSON, default[]). The built-in docker/veth/br-*/cni/flannel/virbr list is always applied;skipInterfacesadds extra case-insensitive name-prefix matches on top.wlan*is not skipped by default, so mDNS advertises on WiFi on a generic/laptop install. Operators who reserve the WiFi radio for another purpose add["wlan"](e.g. the BigFred hub, wherewireless-programmerowns the radio, so mDNS must not leakbigfred.local/ dcc-bus beacons onto a device config network).&[String]throughshould_skip_iface,preferred_ipv4_*,preferred_ipv6_addrs,preferred_iface_indexes, andMdnsPublisher::register, carrying the list viaAnswerSet/DesiredAdsso it flows fromConfigthroughrun.rsandlegacy_unicast.rsand picks up hot-reloads.The matching bigfred-os change sets
skipInterfaces: ["wlan"]in the hub'smicrodns.json.Test plan
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo testclean.skip_virtual_ifaces:wlan0/WLAN0not skipped with&[], skipped with&["wlan"]; built-in virtual ifaces still skipped with&[].