Просмотр исходного кода

fix(vlans): read the VLANs a router and a hypervisor declare (#1757) (#1885)

* fix(vlans): read the VLANs a router declares, not only the kernel's

A router that segments with 802.1Q subinterfaces (eth0.999 into br-iot)
reports every bridge and every subinterface on VLAN 1. That is a valid
answer to a question nobody asked, and it was enough to skip the
configuration entirely, because UCI was only read when the kernel had
nothing to say. The panel then showed a flat list of ports with no
network name and no subnet, and the topology had no VLAN to colour.

Both views are merged on every poll now. The kernel keeps the flags,
the configuration adds the name and the subnet of the network behind
the bridge, the subinterfaces as ports, and the VLAN each of them
tags. A port that only carries the default VLAN loses that answer as
soon as a real VLAN is declared for it.

Refs #1757

* feat(vlans): colour guests and wifi interfaces with their vlan (#1757)

A guest on a Proxmox host hangs from the host bridge, not from a port of
the router, so neither the forwarding table nor `bridge vlan show` can say
which VLAN it is on and every container painted as unlabelled. The
inventory already read each guest config to take its MAC, so it now takes
tag=<vid> from the same line and seals it on the device. A guest without a
tag inherits the VLAN of the host chip, which is the port its host is
plugged into.

The port card groups the AP interfaces an agent reports as plain virtual
interfaces, mixed with bridges and tunnels, and shows no traffic for them.
They get a WiFi group of their own, their rate and the VLAN each one
serves, read from the same table the topology uses.

Both the panel and the topology needed the subinterface to exist as a
port of its own: the forwarding database names eth0.999, not br-iot, and
only the bridge and the parent device had an entry. The network parser
now adds it, and the agent version is bumped because the parser ships in
the binary.

Refs #1757
Nacho 1 месяц назад
Родитель
Сommit
66e7488b9d

+ 6 - 0
CHANGELOG.md

@@ -7,6 +7,12 @@ y este proyecto se adhiere a [Versionado Semántico](https://semver.org/lang/es/
 
 ## [Unreleased]
 
+### Fixed
+
+- A guest of a Proxmox host shows the VLAN its own configuration declares (#1757). A container or a virtual machine hangs from the bridge of the host, never from a port of the router, so the forwarding table and the bridge VLAN table of the router cannot say which VLAN it is on, and every guest painted as unlabelled no matter how it was segmented. The inventory already read the configuration of each guest to get its MAC, so it now takes `tag=<vid>` from the same line and seals it on the device, and a guest without a tag inherits the VLAN of the host chip: that is the port the host is plugged into, which is where its guests actually live.
+- The router card lists WiFi interfaces with their traffic and VLAN (#1757). The AP interfaces an agent reports (`phy0-ap0`, `wlan0`) were grouped as plain virtual interfaces, mixed with bridges and tunnels, so the WiFi of an access point could only be read by guessing which row was which. They have a WiFi group of their own now, each row carries its rate and the VLAN the interface serves, and that VLAN comes from the same table the topology uses, so the SSID that feeds a segmented network can be matched to it without leaving the card.
+- The VLAN panel reads the configuration even when the kernel answers (#1757). A router that segments with 802.1Q subinterfaces reports every bridge and every subinterface on VLAN 1, an answer valid enough that the configuration was never consulted, so the panel showed a flat list of ports with no name and no subnet, and the topology had nothing to colour. Both views are merged on every poll now: the kernel keeps the flags, the configuration adds the network name, its subnet and the VLANs that only exist as a subinterface, and a default answer no longer shadows them.
+
 ### Changed
 
 - An unknown device alerts only when something proves a host is there (#1818). The unnamed MAC that appears in a bridge or switch forwarding table for a few seconds is now ignored, which is what a Netgear unit does while it reboots to flash firmware: NMRP announces an address that never asks for a lease and never answers ARP, and every firmware update used to leave a stranger in the client list. The alert now needs an address resolved by DHCP, ARP, ND or mDNS, a wireless association or an LLDP neighbour, so a laptop that really joins the network still reports on the first poll. The three-tick grace stays, since at the default 30 second cadence it already covers the minute of dwell the report asked for.

+ 1 - 1
agent/VERSION

@@ -1 +1 @@
-3.0.35
+3.0.36

+ 19 - 12
agent/probe/local.go

@@ -333,27 +333,34 @@ func (p *Prober) scanWithFallback(ctx context.Context, ifaces []IwDevIface, chos
 	return used, "", lastErr
 }
 
-// probeVlans reports the bridge VLANs, preferring what the kernel says over
-// what the config declares.
+// probeVlans reports the bridge VLANs, merging what the kernel says with what
+// the configuration declares.
 //
 // The section has existed in the payload since VLANs were added, but
 // nothing ever filled it: only the server's own SSH probe did, and a router
 // reached through its agent never takes that path, so its VLAN panel has
-// always been empty. The fallback matters just as much — `bridge` lives in
-// an optional package, and a router without it has VLANs that only the
-// configuration knows about.
+// always been empty.
+//
+// Neither source is enough on its own. `bridge` lives in an optional package,
+// so plenty of routers have VLANs only the configuration knows about. And a
+// box that segments with 802.1Q subinterfaces (eth0.999 into br-iot) answers
+// with every port on VLAN 1, a valid-looking answer that says nothing about
+// the real layout. The two views are therefore merged always, the kernel
+// owning the flags and the configuration the names, subnets and the VLANs
+// that only exist as subinterfaces (#1757).
 func (p *Prober) probeVlans(ctx context.Context) []VlanPort {
+	var kernel []VlanPort
 	if out := p.runBest(ctx, CmdBridgeVlan, 0); out != "" {
-		if ports := ParseBridgeVlan(out); len(ports) > 0 {
-			return ports
-		}
+		kernel = ParseBridgeVlan(out)
 	}
+	var declared []VlanPort
 	if out := p.runBest(ctx, CmdUciBridgeVlan, 0); out != "" {
-		if ports := ParseUciBridgeVlans(out); len(ports) > 0 {
-			return ports
-		}
+		// A router uses one model or the other, so the two UCI parsers
+		// never describe the same port: bridge-vlan sections name bridge
+		// ports, the subinterface model names bridges and their parents.
+		declared = MergeVlanPorts(ParseUciBridgeVlans(out), ParseUciNetworkVlans(out))
 	}
-	return nil
+	return MergeVlanPorts(kernel, declared)
 }
 
 // runBest es best-effort: error → "" (la sección queda ausente).

+ 8 - 3
agent/probe/probe.go

@@ -235,9 +235,11 @@ const (
 	CmdNetworkDump = "ubus call network.interface dump 2>/dev/null || true"
 	CmdBridgeVlan  = "bridge vlan show 2>/dev/null || true"
 	// CmdUciBridgeVlan: the VLANs as configured, for the routers whose
-	// firmware carries no `bridge` binary — an optional package, and
-	// absent on plenty of boards that do use VLANs.
-	CmdUciBridgeVlan = `uci -q show network 2>/dev/null | grep -E "=bridge-vlan$|\.(device|vlan|ports)=" || true`
+	// firmware carries no `bridge` binary (an optional package, absent on
+	// plenty of boards that do use VLANs) and for the ones that segment
+	// with 802.1Q subinterfaces, which the kernel reports all on VLAN 1
+	// (#1757). Both models are read from `uci show network`.
+	CmdUciBridgeVlan = `uci -q show network 2>/dev/null | grep -E "=bridge-vlan$|=device$|\.(device|vlan|ports|type|name|proto|ipaddr|netmask)=" || true`
 
 	// CmdMdnsBrowse (#338): mDNS service discovery via umdns (OpenWrt's
 	// lightweight mDNS daemon). Returns JSON with hostname -> services.
@@ -1589,6 +1591,9 @@ type VlanEntry struct {
 	// Name es la etiqueta que LuCI da a la VLAN (uci show network, #258),
 	// rellenada por el servidor al juntarla con VlanLabels (#1757).
 	Name string `json:"name,omitempty"`
+	// Subnet es la red que sirve la VLAN (192.168.111.1/24), sacada de la
+	// interfaz que vive en el bridge (#1757).
+	Subnet string `json:"subnet,omitempty"`
 }
 
 // VlanPort: puerto del bridge con sus VLANs (issue #315).

+ 262 - 0
agent/probe/vlan_network.go

@@ -0,0 +1,262 @@
+package probe
+
+import (
+	"fmt"
+	"net"
+	"regexp"
+	"strconv"
+	"strings"
+)
+
+// vlanSubifRe matches an 802.1Q subinterface: the parent device and the VLAN
+// id in its name, the way Linux and OpenWrt build them (eth0.666).
+var vlanSubifRe = regexp.MustCompile(`^([^.]+)\.(\d{1,4})$`)
+
+// ParseUciNetworkVlans derives the VLANs of a router that segments with
+// 802.1Q subinterfaces instead of bridge VLAN filtering (#1757).
+//
+// `bridge vlan show` only knows about bridges with vlan_filtering enabled. A
+// box that creates one bridge per network and feeds it a tagged subinterface
+// (eth0.999 into br-iot) reports every bridge on its default VLAN 1, so the
+// kernel view is blind to the real segmentation and the panel shows a flat
+// list of ports. The configuration is the only place that says which VLAN a
+// bridge carries, which interface it belongs to and what subnet it serves, so
+// it is read as a source of its own and merged with the kernel output, never
+// as a fallback.
+func ParseUciNetworkVlans(out string) []VlanPort {
+	type section map[string]string
+	sections := map[string]section{}
+	order := []string{}
+	for _, line := range strings.Split(out, "\n") {
+		line = strings.TrimSpace(line)
+		if !strings.HasPrefix(line, "network.") {
+			continue
+		}
+		key, val, ok := strings.Cut(strings.TrimPrefix(line, "network."), "=")
+		if !ok {
+			continue
+		}
+		val = strings.Trim(val, "'")
+		name, attr, isAttr := strings.Cut(key, ".")
+		if _, seen := sections[name]; !seen {
+			sections[name] = section{}
+			order = append(order, name)
+		}
+		if !isAttr {
+			sections[name]["@type"] = val
+			continue
+		}
+		sections[name][attr] = val
+	}
+
+	// Interfaces first: they carry the name and the subnet of whatever device
+	// they sit on.
+	type netinfo struct {
+		label  string
+		subnet string
+	}
+	byDevice := map[string]netinfo{}
+	for _, name := range order {
+		s := sections[name]
+		if s["@type"] != "interface" {
+			continue
+		}
+		dev := s["device"]
+		if dev == "" {
+			dev = s["ifname"]
+		}
+		if dev == "" {
+			continue
+		}
+		if _, seen := byDevice[dev]; seen {
+			continue
+		}
+		byDevice[dev] = netinfo{label: name, subnet: vlanSubnet(s["ipaddr"], s["netmask"])}
+	}
+
+	byPort := map[string][]VlanEntry{}
+	portOrder := []string{}
+	add := func(port string, e VlanEntry) {
+		if _, seen := byPort[port]; !seen {
+			portOrder = append(portOrder, port)
+		}
+		byPort[port] = append(byPort[port], e)
+	}
+
+	for _, name := range order {
+		s := sections[name]
+		// The section type is what matters, not the header: a named device
+		// section prints as `network.x=device`, an anonymous one as
+		// `network.@device[0]=device`, and both declare type 'bridge'.
+		if s["type"] != "bridge" {
+			continue
+		}
+		bridge := s["name"]
+		if bridge == "" {
+			continue
+		}
+		info := byDevice[bridge]
+		native := true
+		for _, port := range splitUciList(s["ports"]) {
+			m := vlanSubifRe.FindStringSubmatch(port)
+			if m == nil {
+				continue
+			}
+			vid, err := strconv.Atoi(m[2])
+			if err != nil || vid < 1 || vid > 4094 {
+				continue
+			}
+			native = false
+			// The bridge carries the VLAN the subinterface tags on the parent
+			// port: the members of the VLAN are the ports of the bridge.
+			add(bridge, VlanEntry{ID: vid, PVID: true, Name: info.label, Subnet: info.subnet})
+			// The subinterface itself is the bridge port the forwarding
+			// database reports for every device behind it, so it needs its own
+			// entry: without it the topology has no way to colour a device that
+			// hangs from eth0.999 (#1757).
+			add(port, VlanEntry{ID: vid, PVID: true, Name: info.label, Subnet: info.subnet})
+			add(m[1], VlanEntry{ID: vid, Tagged: true})
+		}
+		// No subinterface among the members: the bridge is a plain untagged
+		// network, which still has a name and a subnet worth showing.
+		if native {
+			add(bridge, VlanEntry{ID: 1, PVID: true, Name: info.label, Subnet: info.subnet})
+		}
+	}
+
+	// An interface bound straight to a subinterface, with no bridge in
+	// between (eth0.50 for a PPPoE or a routed VLAN).
+	for _, name := range order {
+		s := sections[name]
+		if s["@type"] != "interface" {
+			continue
+		}
+		dev := s["device"]
+		m := vlanSubifRe.FindStringSubmatch(dev)
+		if m == nil {
+			continue
+		}
+		vid, err := strconv.Atoi(m[2])
+		if err != nil || vid < 1 || vid > 4094 {
+			continue
+		}
+		add(dev, VlanEntry{ID: vid, PVID: true, Name: name, Subnet: vlanSubnet(s["ipaddr"], s["netmask"])})
+	}
+
+	res := make([]VlanPort, 0, len(portOrder))
+	for _, port := range portOrder {
+		res = append(res, VlanPort{Port: port, Vlans: byPort[port]})
+	}
+	return res
+}
+
+// MergeVlanPorts unions two views of the same VLAN tables, keeping the order
+// of the kernel one. Where both describe the same port and VLAN, the kernel
+// owns the flags (it is what the box is doing) and the declared view fills in
+// what the kernel cannot know: the name of the network and its subnet.
+func MergeVlanPorts(kernel, declared []VlanPort) []VlanPort {
+	if len(declared) == 0 {
+		return kernel
+	}
+	if len(kernel) == 0 {
+		return declared
+	}
+	idx := make(map[string]int, len(kernel)+len(declared))
+	out := make([]VlanPort, 0, len(kernel)+len(declared))
+	for _, p := range kernel {
+		idx[p.Port] = len(out)
+		out = append(out, VlanPort{Port: p.Port, Vlans: append([]VlanEntry(nil), p.Vlans...)})
+	}
+	for _, p := range declared {
+		if i, ok := idx[p.Port]; ok {
+			out[i].Vlans = mergeVlanEntries(out[i].Vlans, p.Vlans)
+			continue
+		}
+		idx[p.Port] = len(out)
+		out = append(out, VlanPort{Port: p.Port, Vlans: append([]VlanEntry(nil), p.Vlans...)})
+	}
+	return out
+}
+
+func mergeVlanEntries(kernel, declared []VlanEntry) []VlanEntry {
+	// A bridge without vlan_filtering answers every port with VLAN 1. That is
+	// not a wrong answer, it is answering a different question, and keeping
+	// it beside the real VLANs of the port would leave them invisible.
+	if vlanOnlyDefault(kernel) && vlanHasReal(declared) {
+		return append([]VlanEntry(nil), declared...)
+	}
+	res := append([]VlanEntry(nil), kernel...)
+	byID := make(map[int]int, len(res))
+	for i, e := range res {
+		byID[e.ID] = i
+	}
+	for _, d := range declared {
+		i, ok := byID[d.ID]
+		if !ok {
+			byID[d.ID] = len(res)
+			res = append(res, d)
+			continue
+		}
+		if res[i].Name == "" {
+			res[i].Name = d.Name
+		}
+		if res[i].Subnet == "" {
+			res[i].Subnet = d.Subnet
+		}
+	}
+	return res
+}
+
+// splitUciList splits a uci list value as `uci show` prints it: every item
+// quoted on the same line.
+func splitUciList(val string) []string {
+	var out []string
+	for _, part := range strings.Split(val, "' '") {
+		if p := strings.TrimSpace(strings.Trim(part, "'")); p != "" {
+			out = append(out, p)
+		}
+	}
+	return out
+}
+
+// vlanSubnet renders an address and a netmask as CIDR. Any missing or
+// malformed piece is dropped rather than guessed.
+func vlanSubnet(ip, mask string) string {
+	if ip == "" {
+		return ""
+	}
+	m := net.ParseIP(mask).To4()
+	if m == nil {
+		return ip
+	}
+	ones, bits := net.IPMask(m).Size()
+	if bits != 32 {
+		return ip
+	}
+	return fmt.Sprintf("%s/%d", ip, ones)
+}
+
+
+
+// vlanOnlyDefault: the kernel reported nothing but the default VLAN.
+func vlanOnlyDefault(entries []VlanEntry) bool {
+	if len(entries) == 0 {
+		return false
+	}
+	for _, e := range entries {
+		if e.ID != 1 {
+			return false
+		}
+	}
+	return true
+}
+
+// vlanHasReal: the view carries at least one VLAN other than the default.
+func vlanHasReal(entries []VlanEntry) bool {
+	for _, e := range entries {
+		if e.ID != 1 {
+			return true
+		}
+	}
+	return false
+}

+ 153 - 0
agent/probe/vlan_network_test.go

@@ -0,0 +1,153 @@
+package probe
+
+import "testing"
+
+// The shape `uci show network` prints on a router that segments with 802.1Q
+// subinterfaces (issue #1757): one bridge per network, each fed a tagged
+// subinterface of the physical port, and one interface per bridge carrying
+// the name and the address of the network. No bridge-vlan sections at all,
+// which is why `bridge vlan show` reports every port on VLAN 1.
+const uciSubifNetworks = `network.Lan=interface
+network.Lan.device='br-lan'
+network.Lan.proto='static'
+network.Lan.ipaddr='192.168.1.1'
+network.Lan.netmask='255.255.255.0'
+network.IOT=interface
+network.IOT.device='br-iot'
+network.IOT.proto='static'
+network.IOT.ipaddr='192.168.111.1'
+network.IOT.netmask='255.255.255.0'
+network.Services=interface
+network.Services.device='br-services'
+network.Services.proto='static'
+network.Services.ipaddr='192.168.222.1'
+network.Services.netmask='255.255.255.0'
+network.@device[0]=device
+network.@device[0].name='br-lan'
+network.@device[0].type='bridge'
+network.@device[0].ports='eth1' 'eth0'
+network.@device[1]=device
+network.@device[1].name='br-iot'
+network.@device[1].type='bridge'
+network.@device[1].ports='eth0.999'
+network.@device[2]=device
+network.@device[2].name='br-services'
+network.@device[2].type='bridge'
+network.@device[2].ports='eth0.555'
+`
+
+func TestParseUciNetworkVlansReadsSubinterfaces(t *testing.T) {
+	ports := ParseUciNetworkVlans(uciSubifNetworks)
+
+	iot := vlansOf(ports, "br-iot")
+	if len(iot) != 1 {
+		t.Fatalf("br-iot = %+v, want one VLAN", iot)
+	}
+	if iot[0].ID != 999 || !iot[0].PVID || iot[0].Tagged {
+		t.Fatalf("br-iot vlan = %+v, want 999 as the native VLAN of the bridge", iot[0])
+	}
+	if iot[0].Name != "IOT" || iot[0].Subnet != "192.168.111.1/24" {
+		t.Fatalf("br-iot name/subnet = %q %q", iot[0].Name, iot[0].Subnet)
+	}
+
+	// The physical port carries it tagged. This is what tells a client behind
+	// eth0 which VLAN it is on.
+	eth0 := vlansOf(ports, "eth0")
+	if len(eth0) != 2 {
+		t.Fatalf("eth0 = %+v, want the tagged VLANs 999 and 555", eth0)
+	}
+	if eth0[0].ID != 999 || !eth0[0].Tagged {
+		t.Fatalf("eth0 vlan = %+v, want 999 tagged", eth0[0])
+	}
+
+	// A bridge with no subinterface is a plain untagged network, and still
+	// has a name and a subnet worth showing.
+	lan := vlansOf(ports, "br-lan")
+	if len(lan) != 1 || lan[0].ID != 1 || lan[0].Name != "Lan" || lan[0].Subnet != "192.168.1.1/24" {
+		t.Fatalf("br-lan = %+v", lan)
+	}
+
+	// The forwarding database names the bridge port, which here is the
+	// subinterface: it has to resolve to the same VLAN as the bridge or a
+	// device behind eth0.999 shows no VLAN at all (#1757).
+	sub := vlansOf(ports, "eth0.999")
+	if len(sub) != 1 || sub[0].ID != 999 || sub[0].Name != "IOT" || !sub[0].PVID {
+		t.Fatalf("eth0.999 = %+v, want VLAN 999 (the port the FDB reports)", sub)
+	}
+}
+
+func TestParseUciNetworkVlansIgnoresNonBridges(t *testing.T) {
+	noise := `network.wan=interface
+network.wan.device='eth1.836'
+network.wan.proto='dhcp'
+network.@device[0]=device
+network.@device[0].name='br-lan'
+network.@device[0].type='bridge'
+network.@device[0].ports='eth0' 'eth1'
+`
+	ports := ParseUciNetworkVlans(noise)
+	// The bridge is untagged, so it is LAN 1. The WAN is bound straight to a
+	// subinterface, with no bridge in between, and it is still VLAN 836.
+	if got := vlansOf(ports, "eth1.836"); len(got) != 1 || got[0].ID != 836 || !got[0].PVID {
+		t.Fatalf("eth1.836 = %+v, want the WAN VLAN", got)
+	}
+	if got := vlansOf(ports, "eth1"); len(got) != 0 {
+		t.Fatalf("eth1 = %+v, want nothing: it is a plain member, not a VLAN", got)
+	}
+}
+
+func TestParseUciNetworkVlansNeedsNoMasquerade(t *testing.T) {
+	// `uci show` order is stable but nothing guarantees the section header
+	// comes before its options, and a missing netmask must not invent a /24.
+	out := `network.iot.proto='static'
+network.iot.device='br-iot'
+network.iot=interface
+network.iot.ipaddr='10.0.0.1'
+network.dev.ports='eth0.42'
+network.dev.type='bridge'
+network.dev.name='br-iot'
+network.dev=device
+`
+	ports := ParseUciNetworkVlans(out)
+	iot := vlansOf(ports, "br-iot")
+	if len(iot) != 1 || iot[0].ID != 42 || iot[0].Subnet != "10.0.0.1" {
+		t.Fatalf("br-iot = %+v", iot)
+	}
+}
+
+// A router without vlan_filtering answers "VLAN 1" for every port. That is a
+// valid answer to a question nobody asked, and it must not shadow the real
+// segmentation.
+const ruttoBridgeVlan = `port    vlan-id
+eth0    1 PVID Egress Untagged
+eth0.999    1 PVID Egress Untagged
+br-iot    1 PVID Egress Untagged
+`
+
+func TestMergeVlanPortsDropsTheDefaultVlan(t *testing.T) {
+	kernel := ParseBridgeVlan(ruttoBridgeVlan)
+	declared := ParseUciNetworkVlans(uciSubifNetworks)
+	merged := MergeVlanPorts(kernel, declared)
+
+	iot := vlansOf(merged, "br-iot")
+	if len(iot) != 1 || iot[0].ID != 999 {
+		t.Fatalf("br-iot = %+v, want only the real VLAN", iot)
+	}
+	// Ports the kernel knows and the config does not are kept untouched.
+	if got := vlansOf(merged, "eth0"); len(got) != 2 || got[0].ID != 999 || got[1].ID != 555 {
+		t.Fatalf("eth0 = %+v, want the declared VLANs behind the kernel ones", got)
+	}
+}
+
+func TestMergeVlanPortsKeepsKernelFlags(t *testing.T) {
+	kernel := []VlanPort{{Port: "lan2", Vlans: []VlanEntry{{ID: 10, Tagged: true}}}}
+	declared := []VlanPort{{Port: "lan2", Vlans: []VlanEntry{{ID: 10, Name: "IoT", Subnet: "10.0.0.1/24"}}}}
+	merged := MergeVlanPorts(kernel, declared)
+	if len(merged) != 1 || len(merged[0].Vlans) != 1 {
+		t.Fatalf("merged = %+v", merged)
+	}
+	e := merged[0].Vlans[0]
+	if !e.Tagged || e.Name != "IoT" || e.Subnet != "10.0.0.1/24" {
+		t.Fatalf("entry = %+v, want the kernel flags and the declared name", e)
+	}
+}

+ 4 - 1
app/public/locales/en/translation.json

@@ -1098,7 +1098,8 @@
       "fam_vlan": "VLAN",
       "fam_bridge": "Bridge",
       "fam_tunnel": "Tunnel",
-      "fam_virtual": "Virtual"
+      "fam_virtual": "Virtual",
+      "fam_wifi": "WiFi"
     },
     "radios": {
       "channel": "Channel",
@@ -1114,9 +1115,11 @@
       "summary": "SNMP: {{ok}} polls OK / {{fail}} failures"
     },
     "vlans": {
+      "id": "ID",
       "mode": "Mode",
       "port": "Port",
       "pvid": "PVID",
+      "subnet": "Subnet",
       "tagged": "Tagged",
       "title": "VLANs",
       "toggleAria": "Bridge VLANs ({{count}})",

+ 4 - 1
app/public/locales/es/translation.json

@@ -1098,7 +1098,8 @@
       "fam_vlan": "VLAN",
       "fam_bridge": "Bridge",
       "fam_tunnel": "Túnel",
-      "fam_virtual": "Virtual"
+      "fam_virtual": "Virtual",
+      "fam_wifi": "WiFi"
     },
     "radios": {
       "channel": "Canal",
@@ -1114,9 +1115,11 @@
       "summary": "SNMP: {{ok}} polls OK / {{fail}} fallos"
     },
     "vlans": {
+      "id": "ID",
       "mode": "Modo",
       "port": "Puerto",
       "pvid": "PVID",
+      "subnet": "Subred",
       "tagged": "Tagged",
       "title": "VLANs",
       "toggleAria": "VLANs del bridge ({{count}})",

+ 33 - 4
app/src/components/routers/PortPanel.tsx

@@ -292,13 +292,16 @@ function MiniStat({ label, value }: { label: string; value: string }) {
 }
 
 // FAMILY_LABEL_KEY (#1125): familia ifType (IANA) -> clave i18n de la
-// etiqueta del grupo de interfaces virtuales. Cerrado: el server solo emite
-// estas cinco ("lag"|"vlan"|"bridge"|"tunnel"|"virtual").
+// etiqueta del grupo de interfaces virtuales. El server emite las cinco de
+// ifType ("lag"|"vlan"|"bridge"|"tunnel"|"virtual") y, desde #1757, "wifi"
+// para las interfaces AP del agente (phy0-ap0, wlan0: /proc/net/dev no da
+// ifType, así que se reconoce por nombre).
 const FAMILY_LABEL_KEY: Record<string, string> = {
   lag: 'routerDetail.ports.fam_lag',
   vlan: 'routerDetail.ports.fam_vlan',
   bridge: 'routerDetail.ports.fam_bridge',
   tunnel: 'routerDetail.ports.fam_tunnel',
+  wifi: 'routerDetail.ports.fam_wifi',
   virtual: 'routerDetail.ports.fam_virtual',
 }
 
@@ -324,6 +327,15 @@ export function PortPanel({ router, extras, className, snmpStats }: {
       return next
     })
   const used = ports.filter((p) => p.up).length
+  // #1757: VLAN de una interfaz no física, cruzando su nombre con la tabla de
+  // VLANs del router (la misma regla que usa la topología: PVID manda y sin
+  // PVID se toma la primera entrada). En un AP las interfaces AP aparecen
+  // como puertos del bridge, así que esto dice a qué VLAN sirve cada SSID.
+  const vlanOfIface = (p: EthPort) => {
+    const name = p.iface ?? p.label
+    const entry = router.vlans?.find((e) => e.port === name)
+    return entry ? (entry.vlans.find((v) => v.pvid) ?? entry.vlans[0]) : undefined
+  }
   const wirelessUplink = ex.backhaul?.kind === 'wireless'
   // #1383: la info WAN del contexto es la del gateway; pintarla en la boca
   // "wan" de cualquier otra unidad (p.ej. un AP cuyo uplink entra por su ex
@@ -410,13 +422,29 @@ export function PortPanel({ router, extras, className, snmpStats }: {
           </button>
           {virtualOpen && (
             <ul className="border-t border-border/60 px-4 py-2">
-              {virtualPorts.map((p) => (
+              {virtualPorts.map((p) => {
+                const vl = vlanOfIface(p)
+                const hasRate = p.rxBps !== undefined || p.txBps !== undefined
+                return (
                 <li key={p.id} className="flex items-center gap-3 py-1.5 text-caption">
                   <span className="inline-flex w-16 shrink-0 justify-center rounded border border-border px-1.5 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-wide text-text-muted">
                     {t(FAMILY_LABEL_KEY[p.family ?? ''] ?? 'routerDetail.ports.fam_virtual', { defaultValue: p.family })}
                   </span>
                   <span className="truncate font-mono text-mono-sm text-text-primary">{p.label}</span>
+                  {vl && (
+                    <span
+                      className="shrink-0 rounded border border-border px-1 font-mono text-[10px] text-text-muted"
+                      title={vl.name ? `${t('routerDetail.vlans.id')} ${vl.id} · ${vl.name}` : `${t('routerDetail.vlans.id')} ${vl.id}`}
+                    >
+                      {t('routerDetail.vlans.id')} {vl.id}
+                    </span>
+                  )}
                   <span className="ml-auto inline-flex shrink-0 items-center gap-2">
+                    {hasRate && (
+                      <span className="font-mono text-[10px] text-text-muted">
+                        ↓ {fmtPortBps(p.rxBps)} ↑ {fmtPortBps(p.txBps)}
+                      </span>
+                    )}
                     {p.speed && <span className="text-text-muted">{p.speed}</span>}
                     <span
                       className={p.up ? 'h-1.5 w-1.5 rounded-full bg-ok' : 'h-1.5 w-1.5 rounded-full bg-border-strong/50'}
@@ -424,7 +452,8 @@ export function PortPanel({ router, extras, className, snmpStats }: {
                     />
                   </span>
                 </li>
-              ))}
+                )
+              })}
             </ul>
           )}
         </div>

+ 4 - 0
app/src/components/routers/VlanPanel.tsx

@@ -71,6 +71,7 @@ export function VlanPanel({ vlans }: { vlans: VlanPort[] }) {
                   <tr className="border-b border-border/60 text-[10px] font-semibold uppercase tracking-[0.06em] text-text-muted">
                     <th className="pb-2 pr-4">{t('routerDetail.vlans.port')}</th>
                     <th className="pb-2 pr-4">{t('routerDetail.vlans.vlanId')}</th>
+                    <th className="pb-2 pr-4">{t('routerDetail.vlans.subnet')}</th>
                     <th className="pb-2 pr-4">{t('routerDetail.vlans.mode')}</th>
                     <th className="pb-2">{t('routerDetail.vlans.pvid')}</th>
                   </tr>
@@ -107,6 +108,9 @@ export function VlanPanel({ vlans }: { vlans: VlanPort[] }) {
                             <span className="ml-2 font-sans text-[11px] text-text-muted">{v.name}</span>
                           )}
                         </td>
+                        <td className="py-2 pr-4 font-mono text-mono-sm text-text-secondary">
+                          {v.subnet ?? '-'}
+                        </td>
                         <td className="py-2 pr-4"><VlanBadge tagged={v.tagged} /></td>
                         <td className="py-2">
                           {v.pvid ? (

+ 10 - 0
app/src/components/topology/model.ts

@@ -1055,6 +1055,10 @@ export function buildTopologyModel({ routers, devices, wan, wireguard, distribut
   // PVID se toma la primera entrada. Solo cableado: la API no declara la VLAN
   // de un cliente WiFi, y suponerla sería inventar el dato.
   const vlanOf = (d: Device): ChipNode['vlan'] => {
+    // #1757: la VLAN que declara el propio device (inventario de Proxmox,
+    // tag= de la config del invitado) manda: el router no puede verla porque
+    // el invitado cuelga del bridge del host, no de un puerto suyo.
+    if (d.vlan) return { id: d.vlan, pvid: false }
     // #1757: `bridge vlan show` lista también las interfaces AP (wlan0,
     // wlan1) como puertos del bridge, así que la estación inalámbrica se
     // resuelve por su interfaz igual que un cliente cableado por su puerto.
@@ -1294,7 +1298,13 @@ export function buildTopologyModel({ routers, devices, wan, wireguard, distribut
     const hostChip = chips.find((c) => c.id === hostId)
     const kids = childrenOf(hostId).map((d) => mkChip(d, hostId, true))
     if (!hostChip || kids.length === 0) continue
+    // #1757: un invitado cuelga del bridge del host, no de un puerto del
+    // router, así que su VLAN no está en `bridge vlan show`. Cuando Proxmox no
+    // declara tag= (invitado en la VLAN nativa del bridge) hereda la VLAN del
+    // chip del host, que es la del puerto donde ese host está conectado.
+    const hostVlan = hostChip.vlan
     kids.forEach((c, i) => {
+      if (!c.vlan && hostVlan) c.vlan = hostVlan
       c.x = hostChip.x - ((Math.min(kids.length, CT_COLS) - 1) * CT_DX) / 2 + (i % CT_COLS) * CT_DX
       c.y = hostChip.y + CT_OFFSET_Y + Math.floor(i / CT_COLS) * CT_DY
       c.size = 22

+ 8 - 0
app/src/data/types.ts

@@ -299,6 +299,12 @@ export interface Device {
    * puede seguir infiriendo como fallback para datos viejos, B2).
    */
   infra?: DeviceInfra
+  /**
+   * VLAN que declara una fuente que la conoce (hoy, el inventario de Proxmox
+   * leyendo tag= de la config del invitado). El router no puede deducirla
+   * porque el invitado cuelga del bridge del host (#1757). Ausente = sin dato.
+   */
+  vlan?: number
   /** Segundos restantes del lease DHCP (issue #437). */
   leaseRemaining?: number | null
   /** Nombre del icono manual elegido por el usuario (issue #437). */
@@ -456,6 +462,8 @@ export interface VlanEntry {
   pvid: boolean
   /** LuCI's name for the VLAN (uci show network), when the router has one. */
   name?: string
+  /** #1757: the network the VLAN serves, e.g. 192.168.111.1/24. */
+  subnet?: string
 }
 
 /** One internet connection of a router that has several. Read-only: the

+ 7 - 0
server-go/internal/adapters/agent.go

@@ -705,6 +705,13 @@ func virtualIfaceFamily(name string) string {
 		return "vlan"
 	case strings.HasPrefix(name, "br"), name == "bridge":
 		return "bridge"
+	// #1757: las interfaces AP no tienen ifType en /proc/net/dev. En OpenWrt
+	// son phy<N>-ap<N> (hostapd sobre mac80211) y en otras plataformas
+	// wlan<N>: verlas como "virtual" a secas esconde que son el WiFi, que es
+	// justo lo que se quiere leer por interfaz.
+	case strings.HasPrefix(name, "phy") && strings.Contains(name, "-ap"),
+		strings.HasPrefix(name, "wlan"):
+		return "wifi"
 	case strings.HasPrefix(name, "bond"), strings.HasPrefix(name, "lag"):
 		return "lag"
 	case strings.HasPrefix(name, "tun"), strings.HasPrefix(name, "tap"), strings.HasPrefix(name, "wg"),

+ 13 - 6
server-go/internal/adapters/openwrt.go

@@ -652,14 +652,21 @@ func (c *OpenWrtClient) GetLuCILabels() *probe.LuCILabels {
 	return probe.ParseLuCILabels(out)
 }
 
-// GetBridgeVlans: VLANs del bridge (issue #315). Salida de `bridge vlan show`
-// parseada; nil si el router no tiene bridge vlan filtering o falla la sonda.
+// GetBridgeVlans: VLANs del bridge (issue #315). La salida del kernel se
+// fusiona con la configuración (#1757): un router que segmenta con
+// subinterfaces 802.1Q contesta con todos los puertos en la VLAN 1 y las
+// VLANs reales solo están en `uci show network`. nil si ninguna de las dos
+// fuentes dice nada.
 func (c *OpenWrtClient) GetBridgeVlans() []probe.VlanPort {
-	out, err := c.pool.Run(c.Host, probe.CmdBridgeVlan, 0)
-	if err != nil {
-		return nil
+	var kernel []probe.VlanPort
+	if out, err := c.pool.Run(c.Host, probe.CmdBridgeVlan, 0); err == nil {
+		kernel = probe.ParseBridgeVlan(out)
+	}
+	var declared []probe.VlanPort
+	if out, err := c.pool.Run(c.Host, probe.CmdUciBridgeVlan, 0); err == nil {
+		declared = probe.MergeVlanPorts(probe.ParseUciBridgeVlans(out), probe.ParseUciNetworkVlans(out))
 	}
-	ports := probe.ParseBridgeVlan(out)
+	ports := probe.MergeVlanPorts(kernel, declared)
 	if len(ports) == 0 {
 		return nil
 	}

+ 12 - 2
server-go/internal/adapters/proxmox.go

@@ -64,6 +64,10 @@ type pveVM struct {
 	Node     string // nodo que lo ejecuta (citadel-01)
 	Type     string // "lxc" | "qemu"
 	Instance string // instancia Proxmox a la que pertenece (#764)
+	// Tag: VLAN del guest según la config de Proxmox (tag=<vid>), 0 si está
+	// en la VLAN nativa del bridge. Es el único sitio donde consta: el router
+	// no la ve porque el guest cuelga del bridge del host (#1757).
+	Tag int
 }
 
 // pveNode: un nodo PVE con su instancia de origen.
@@ -254,8 +258,8 @@ func (l *Live) fetchPveInventory(clients []pveInstClient) *pveInventory {
 				log.Printf("[netpulse:pve] %s config %s/%d: %v", ic.inst.ID, r.Type, r.VMID, err)
 				continue
 			}
-			for _, mac := range pve.MACsOfConfig(cfg) {
-				inv.ctByMAC[mac] = pveVM{Name: r.Name, Node: r.Node, Type: r.Type, Instance: ic.inst.ID}
+			for _, nic := range pve.NICsOfConfig(cfg) {
+				inv.ctByMAC[nic.MAC] = pveVM{Name: r.Name, Node: r.Node, Type: r.Type, Instance: ic.inst.ID, Tag: nic.Tag}
 			}
 		}
 	}
@@ -353,6 +357,12 @@ func applyPVEInfra(devices []Device, dists []DistributionNode, inv *pveInventory
 		} else {
 			devices[idx].Infra = "ct"
 		}
+		// VLAN del invitado según su config en Proxmox: el router no puede
+		// verla porque el guest cuelga del bridge del host, no de un puerto
+		// suyo (#1757).
+		if vm.Tag > 0 {
+			devices[idx].Vlan = vm.Tag
+		}
 		// El nombre del invitado es el que le puso el administrador en
 		// Proxmox, y para un CT suele ser el ÚNICO que hay: no pide DHCP
 		// con hostname, así que sin esto se queda con su MAC por nombre —

+ 26 - 0
server-go/internal/adapters/proxmox_test.go

@@ -55,6 +55,32 @@ func TestSealProxmoxInfra(t *testing.T) {
 	}
 }
 
+// TestSealProxmoxInfraCarriesTheGuestVlan: la VLAN de cada invitado sale de
+// tag= en su config de Proxmox, el único sitio donde consta: cuelga del
+// bridge del host, así que ni el FDB ni `bridge vlan show` del router la ven
+// (#1757). Un invitado sin tag queda en 0 (VLAN nativa del bridge).
+func TestSealProxmoxInfraCarriesTheGuestVlan(t *testing.T) {
+	inv := &pveInventory{
+		ctByMAC: map[string]pveVM{
+			"BC:24:11:00:00:01": {Name: "iot", Node: "pve", Type: "lxc", Instance: "default", Tag: 999},
+			"BC:24:11:00:00:02": {Name: "lan", Node: "pve", Type: "lxc", Instance: "default"},
+		},
+		nodes: map[string]pveNode{"default|pve": {Instance: "default", Node: "pve"}},
+	}
+	devices := []Device{
+		{ID: "pve", MAC: "C8:FF:BF:0C:60:12", Name: "pve"},
+		{ID: "bc-24-11-00-00-01", MAC: "BC:24:11:00:00:01", Name: "iot"},
+		{ID: "bc-24-11-00-00-02", MAC: "BC:24:11:00:00:02", Name: "lan"},
+	}
+	applyPVEInfra(devices, nil, inv)
+	if devices[1].Vlan != 999 {
+		t.Errorf("iot vlan=%d (want 999)", devices[1].Vlan)
+	}
+	if devices[2].Vlan != 0 {
+		t.Errorf("lan vlan=%d (want 0: sin tag, VLAN nativa)", devices[2].Vlan)
+	}
+}
+
 // TestSealProxmoxInfraSinInventario: sin cluster configurado o sin CTs
 // conocidos → no-op (los devices no cambian).
 func TestSealProxmoxInfraSinInventario(t *testing.T) {

+ 4 - 1
server-go/internal/adapters/types.go

@@ -310,13 +310,16 @@ type Device struct {
 	SpeedMbps int `json:"speedMbps,omitempty"`
 	// Infra: rol de infraestructura sellado server-side (Fase 4). La app NO
 	// infiere: pinta badge si viene. "hypervisor" (host Proxmox/VMware/…),
-
 	// "ct" (contenedor anidado bajo hipervisor), "vm" (máquina virtual, que
 	// solo el inventario del hipervisor distingue de un contenedor),
 	// "managed-switch" (switch con gestión identificado por LLDP — hoy
 	// switch-netgear), "ap" (punto de acceso gestionado, p. ej. reportado
 	// por el controlador UniFi).
 	Infra string `json:"infra,omitempty"` // "hypervisor"|"ct"|"vm"|"managed-switch"|"ap"
+	// Vlan: VLAN del dispositivo cuando la declara una fuente que la conoce y
+	// el router no puede verla. Hoy solo el inventario de Proxmox la aporta,
+	// leyendo tag=<vid> de la config del invitado (#1757). 0 = sin dato.
+	Vlan int `json:"vlan,omitempty"`
 	// --- mDNS/SSDP fingerprinting (#338) ---
 	// MdnsServices: mDNS service types advertised by this device (from umdns).
 	// e.g. ["_airplay._tcp", "_raop._tcp"] for an Apple TV.

+ 6 - 2
server-go/internal/adapters/virtual_ports_test.go

@@ -77,8 +77,12 @@ func TestVirtualIfaceFamilyNamesTheFamilies(t *testing.T) {
 		"tun0":      "tunnel",
 		"pppoe-wan": "tunnel",
 		"gre1":      "tunnel",
-		"eth1":      "virtual",
-		"foo0":      "virtual",
+		// #1757: las interfaces AP del agente (OpenWrt mac80211 y wlan<N>).
+		"phy0-ap0": "wifi",
+		"phy1-ap2": "wifi",
+		"wlan0":    "wifi",
+		"eth1":     "virtual",
+		"foo0":     "virtual",
 	}
 	for name, want := range cases {
 		if got := virtualIfaceFamily(name); got != want {

+ 0 - 0
server-go/internal/agentbin/agents/amd64


+ 0 - 0
server-go/internal/agentbin/agents/arm


+ 0 - 0
server-go/internal/agentbin/agents/arm64


+ 0 - 0
server-go/internal/agentbin/agents/mipsle


+ 56 - 21
server-go/internal/pve/pve.go

@@ -29,6 +29,8 @@ import (
 	"io"
 	"net/http"
 	"net/url"
+	"sort"
+	"strconv"
 	"strings"
 	"time"
 )
@@ -218,40 +220,73 @@ func (c *Client) NodeIP(ctx context.Context, node string) (string, error) {
 	return fallback, nil
 }
 
-// MACsOfConfig extrae las MACs de una config de VM/CT. Proxmox expone cada
-// NIC como "net0": "…" con el formato:
+// NIC is one NIC declared in a guest config: the MAC it uses, the VLAN tag it
+// carries and the bridge it hangs from. Proxmox writes tag=<vid> when the
+// guest is not on the native VLAN, and that is the only place the tag exists:
+// the guest sits behind the host bridge, so the router never sees it (#1757).
+type NIC struct {
+	MAC    string
+	Tag    int
+	Bridge string
+}
+
+// NICsOfConfig returns the NICs of a VM/CT config, in net<N> order so the
+// result is stable between polls. Proxmox exposes each NIC as "net0": "…":
 //
 //	LXC:  net0: bridge=vmbr0,hwaddr=BC:24:11:XX:XX:XX,ip=dhcp,name=eth0,type=veth
-//	QEMU: net0: virtio=BC:24:11:XX:XX:XX,bridge=vmbr0   (MAC tras el nombre del modelo)
+//	QEMU: net0: virtio=BC:24:11:XX:XX:XX,bridge=vmbr0   (MAC tras el modelo)
 //
-// Devuelve las MACs normalizadas a mayúsculas con ':'.
-func MACsOfConfig(cfg map[string]any) []string {
-	var out []string
-	for k, v := range cfg {
-		if !strings.HasPrefix(k, "net") {
-			continue
+// MACs are normalised to upper case with ':'.
+func NICsOfConfig(cfg map[string]any) []NIC {
+	keys := make([]string, 0, len(cfg))
+	for k := range cfg {
+		if strings.HasPrefix(k, "net") {
+			keys = append(keys, k)
 		}
-		s, ok := v.(string)
+	}
+	sort.Strings(keys)
+	var out []NIC
+	for _, k := range keys {
+		s, ok := cfg[k].(string)
 		if !ok {
 			continue
 		}
+		var nic NIC
 		for _, field := range strings.Split(s, ",") {
-			if strings.HasPrefix(field, "hwaddr=") {
-				if mac := normMAC(field[len("hwaddr="):]); mac != "" {
-					out = append(out, mac)
+			switch {
+			case strings.HasPrefix(field, "hwaddr="):
+				nic.MAC = normMAC(field[len("hwaddr="):])
+			case strings.HasPrefix(field, "bridge="):
+				nic.Bridge = field[len("bridge="):]
+			case strings.HasPrefix(field, "tag="):
+				if n, err := strconv.Atoi(field[len("tag="):]); err == nil && n > 0 && n < 4095 {
+					nic.Tag = n
 				}
-				continue
-			}
-			// QEMU: el primer campo es <modelo>=<MAC> (virtio=XX, e1000=XX…)
-			if eq := strings.Index(field, "="); eq > 0 {
-				val := field[eq+1:]
-				if looksLikeMAC(val) {
-					if mac := normMAC(val); mac != "" {
-						out = append(out, mac)
+			default:
+				// QEMU: el primer campo es <modelo>=<MAC> (virtio=XX, e1000=XX…)
+				if eq := strings.Index(field, "="); eq > 0 {
+					if looksLikeMAC(field[eq+1:]) {
+						nic.MAC = normMAC(field[eq+1:])
 					}
 				}
 			}
 		}
+		if nic.MAC != "" {
+			out = append(out, nic)
+		}
+	}
+	return out
+}
+
+// MACsOfConfig extrae las MACs de una config de VM/CT (ver NICsOfConfig).
+func MACsOfConfig(cfg map[string]any) []string {
+	nics := NICsOfConfig(cfg)
+	if len(nics) == 0 {
+		return nil
+	}
+	out := make([]string, 0, len(nics))
+	for _, n := range nics {
+		out = append(out, n.MAC)
 	}
 	return out
 }

+ 32 - 0
server-go/internal/pve/pve_test.go

@@ -325,3 +325,35 @@ func TestClientTLSVerification(t *testing.T) {
 		})
 	}
 }
+
+// TestNICsOfConfigReadsTag: la VLAN del invitado solo existe en la config de
+// Proxmox (tag=<vid>), así que el parser tiene que sacarla junto a la MAC
+// (#1757). Un invitado sin tag está en la VLAN nativa del bridge.
+func TestNICsOfConfigReadsTag(t *testing.T) {
+	cfg := map[string]any{
+		"net0": "bridge=vmbr0,hwaddr=BC:24:11:00:00:01,tag=999,ip=dhcp,name=eth0,type=veth",
+		"net1": "virtio=BC:24:11:00:00:02,bridge=vmbr1,tag=42",
+		"net2": "bridge=vmbr0,hwaddr=BC:24:11:00:00:03,ip=dhcp,name=eth2,type=veth",
+		"net3": "bridge=vmbr0,hwaddr=BC:24:11:00:00:04,tag=0",
+	}
+	nics := NICsOfConfig(cfg)
+	if len(nics) != 4 {
+		t.Fatalf("nics: %+v (want 4)", nics)
+	}
+	// net<N> en orden, no el orden aleatorio del map.
+	want := []NIC{
+		{MAC: "BC:24:11:00:00:01", Tag: 999, Bridge: "vmbr0"},
+		{MAC: "BC:24:11:00:00:02", Tag: 42, Bridge: "vmbr1"},
+		{MAC: "BC:24:11:00:00:03", Bridge: "vmbr0"},
+		{MAC: "BC:24:11:00:00:04", Bridge: "vmbr0"},
+	}
+	if !reflect.DeepEqual(nics, want) {
+		t.Fatalf("nics: %+v (want %+v)", nics, want)
+	}
+	// MACsOfConfig sigue devolviendo solo las MACs, en el mismo orden.
+	macs := MACsOfConfig(cfg)
+	wantMACs := []string{"BC:24:11:00:00:01", "BC:24:11:00:00:02", "BC:24:11:00:00:03", "BC:24:11:00:00:04"}
+	if !reflect.DeepEqual(macs, wantMACs) {
+		t.Fatalf("macs: %v (want %v)", macs, wantMACs)
+	}
+}