swconfig: Add cpu port index to help output.
[openwrt/openwrt.git] / package / swconfig / src / swlib.c
index 8a9fd7a29ce8b3659d057ab350400321a598b0e4..59456a33d9d5717c38f6abae2a647f6bb3281ef5 100644 (file)
@@ -586,6 +586,8 @@ add_switch(struct nl_msg *msg, void *arg)
                dev->ports = nla_get_u32(tb[SWITCH_ATTR_PORTS]);
        if (tb[SWITCH_ATTR_VLANS])
                dev->vlans = nla_get_u32(tb[SWITCH_ATTR_VLANS]);
+       if (tb[SWITCH_ATTR_CPU_PORT])
+               dev->cpu_port = nla_get_u32(tb[SWITCH_ATTR_CPU_PORT]);
 
        if (!sa->head) {
                sa->head = dev;