+ s.create = function(self, section)
+ local sid = TypedSection.create(self, section)
+
+ local max_nr = 0
+ local max_id = 0
+
+ m.uci:foreach("network", "switch_vlan",
+ function(s)
+ local nr = tonumber(s.vlan)
+ local id = has_vlan4k and tonumber(s[has_vlan4k])
+ if nr ~= nil and nr > max_nr then max_nr = nr end
+ if id ~= nil and id > max_id then max_id = id end
+ end)
+
+ m.uci:set("network", sid, "vlan", max_nr + 1)
+
+ if has_vlan4k then
+ m.uci:set("network", sid, has_vlan4k, max_id + 1)
+ end
+
+ return sid
+ end
+
+