Repository navigation
net: a Kubernetes CNI interface sorts after the real ones among the receiver's LAN addresses - #260
connorburgess wants to merge 3 commits into
Conversation
…eceiver's LAN addresses Symptom: on a Linux machine that is also a Kubernetes node (k3s, kubeadm, kube-router), the phone step's Wi-Fi QR code and address, the Connect page's base, the `sink add` command and the CLI's `trust` line could name a pod address (10.42.0.0 on flannel.1, 10.42.0.1 on cni0...), which the phone cannot reach. With eth0 192.168.1.40, cni0 10.42.0.1 and flannel.1 10.42.0.0, lanAddresses() returned ["10.42.0.0", "10.42.0.1", "192.168.1.40"]. Cause: lanAddresses() recognises a virtual interface by the start of its name, and the list knows container runtimes and hypervisors but no Kubernetes network plugin. cni0, flannel.1, cilium_host, Calico's tunl0, vxlan.calico and wireguard.cali, weave, antrea-gw0, ovn-k8s-mp0 and kube-bridge each matched nothing, so each was unshifted like a real interface, and the last one the OS listed came first. Fix: the same regex also knows cni, flannel, cilium, tunl0, vxlan.calico, wireguard.cali, weave, antrea-gw, ovn-k8s and kube-, anchored at the start of the name and case-insensitive as before. Nothing else changes: real interfaces keep their unshift order, a self-assigned address stays last, and no address is dropped. tunl0 is the kernel's IP-in-IP device, which in practice gets an address from Calico; the pattern is tunl0, not tunl, so a tunnel someone named themselves stays real, as does a VPN (tun0, wg0). Tests cover a Flannel node with Calico, Weave and kube-router interfaces, and a node with Cilium, Antrea and OVN-Kubernetes host interfaces. Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
|
TL;DR
lanAddresses() in server/http/net.ts decides whether an interface is virtual by the start of its name. Real interfaces go first, virtual ones after them, and 169.254 link-local addresses last. Kubernetes network plugins were not in the list, so on a k3s or Flannel node a pod address could come first. That address then ended up in the QR code, the Connect page, No findings sure enough to post from reading the change. Merge confidence 5 of 5 Where to read first
Tests and reachReach: no graph yet, so this review could not trace what the change reaches. Stages: 141 s
|
Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
|
The Kubernetes interface ordering fix still applies to SessionPipe GUI v0.8.18. Merged current Added the previously deferred Unreleased changelog entry. Validation on this head, macOS / Node 22.23.2:
GitHub CI run 47453786130 for head |
Updated against v0.8.18 / main
d16a2c01on 2026-12-05. Current validation and refresh details.What
On a Linux machine that is also a Kubernetes node, the receiver now lists its real LAN address before the node's pod interfaces. This affects the phone step's Wi-Fi QR code and address, the Connect page's base, the
sink addcommand and the CLI'strustline. Before this change, any of them could name a pod address that a phone on the Wi-Fi cannot reach.Why
lanAddresses()inserver/http/net.tsdecides whether an interface is virtual by the start of its name. The list (last extended in #70) covers container runtimes and hypervisors, but no Kubernetes network plugin. Every interface that matches nothing is unshifted as a real one, so whichever one the OS lists last comes first. On a k3s node with Flannel (eth0 192.168.1.40, cni0 10.42.0.1, flannel.1 10.42.0.0),lanAddresses()returned["10.42.0.0", "10.42.0.1", "192.168.1.40"].info.urls.lan[0](server/app.ts) was then a pod address.The same regex now also recognises these names, anchored at the start and case-insensitive as before:
cni: the CNI bridge plugin's cni0, and Podman 3's cni-podman0flannel: flannel.1cilium: cilium_hosttunl0,vxlan.calico,wireguard.cali: Calico in IP-in-IP, VXLAN or WireGuard modeweave: Weave Netantrea-gw: antrea-gw0ovn-k8s: OVN-Kubernetes' ovn-k8s-mp0kube-: kube-router's kube-bridgeNothing else changes. Real interfaces keep their order, a self-assigned 169.254 address stays last, and no address is dropped, so a node whose only interfaces have these names still lists every address. A VPN's interface (tun0, wg0, Tailscale) still counts as real.
tunl0is the kernel's IP-in-IP fallback device. In practice Calico's IP-in-IP mode (the default in thecalico.yamlmanifest) is what gives it an address, and whatever gives it one, a phone on the LAN can't reach that address. The pattern istunl0, nottunl, so a tunnel someone named themselves is left alone. I left outkube-ipvs0: kube-proxy creates it as a dummy device that stays down, and Node'sos.networkInterfaces()doesn't list interfaces that are down.An entry is now included under Unreleased in
CHANGELOG.md. Other open PRs also add release notes; those entries may need combining as the PRs land.Original proof (before the v0.8.18 refresh)
Two new cases in
server/http/net.test.ts:Both fail on main's
net.tsand pass with this change.With
server/http/net.tsfrom main (4ab6eae) and the new tests:With this branch:
That one failure is unrelated to this change. It is a 15 s timeout in the full parallel run on this machine, and unmodified main (4ab6eae) fails the same way:
Run alone, it passes on both main and this branch:
Checklist
git commit -s): the DCO is the only paperwork.npm run typecheck && npm run lint && npm testpass;npm run test:e2efor a UI change. (No UI change. The onenpm testtimeout above happens on main too and passes alone.)// SPDX-License-Identifier: Apache-2.0. (No new files.)--demo). (Addresses in the tests are private-range examples.)shared/*names the wire-contract change in the description. (Noshared/*change.)CHANGELOG.md.