swconfig: fix vlan/port configs being applied to all switches
[openwrt/openwrt.git] / package / swconfig / src / uci.c
index 1de689ce6e3e303641a36a273064ccf5257044be..893e3d1dd8f61e02678884f9beddb81dbd839fe8 100644 (file)
@@ -183,7 +183,7 @@ found:
                                        port = o->v.string;
                                }
                        }
-                       if (!dev || !port || !port[0])
+                       if (!devn || !port || !port[0])
                                continue;
 
                        port_n = strtoul(port, &port_err, 0);
@@ -208,7 +208,7 @@ found:
                                        vlan = o->v.string;
                                }
                        }
-                       if (!dev || !vlan || !vlan[0])
+                       if (!devn || !vlan || !vlan[0])
                                continue;
 
                        vlan_n = strtoul(vlan, &vlan_err, 0);