]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/iplink_bridge_slave.c
ip: bridge: add mcast to unicast config flag
[mirror_iproute2.git] / ip / iplink_bridge_slave.c
index 8b4f93f265be9f2519c85236aabe29184724868d..ae9d15fcf5065ddb97e15bd7f516081ff1f2c37a 100644 (file)
@@ -37,6 +37,7 @@ static void print_explain(FILE *f)
                "                        [ mcast_router MULTICAST_ROUTER ]\n"
                "                        [ mcast_fast_leave {on | off} ]\n"
                "                        [ mcast_flood {on | off} ]\n"
+               "                        [ mcast_to_unicast {on | off} ]\n"
                "                        [ group_fwd_mask MASK ]\n"
                "                        [ neigh_suppress {on | off} ]\n"
                "                        [ vlan_tunnel {on | off} ]\n"
@@ -168,11 +169,11 @@ static void bridge_slave_print_opt(struct link_util *lu, FILE *f,
                             rta_getattr_u8(tb[IFLA_BRPORT_UNICAST_FLOOD]));
 
        if (tb[IFLA_BRPORT_ID])
-               print_0xhex(PRINT_ANY, "id", "port_id 0x%x ",
+               print_0xhex(PRINT_ANY, "id", "port_id %#llx ",
                            rta_getattr_u16(tb[IFLA_BRPORT_ID]));
 
        if (tb[IFLA_BRPORT_NO])
-               print_0xhex(PRINT_ANY, "no", "port_no 0x%x ",
+               print_0xhex(PRINT_ANY, "no", "port_no %#llx ",
                           rta_getattr_u16(tb[IFLA_BRPORT_NO]));
 
        if (tb[IFLA_BRPORT_DESIGNATED_PORT])
@@ -257,6 +258,10 @@ static void bridge_slave_print_opt(struct link_util *lu, FILE *f,
                _print_onoff(f, "mcast_flood", "mcast_flood",
                             rta_getattr_u8(tb[IFLA_BRPORT_MCAST_FLOOD]));
 
+       if (tb[IFLA_BRPORT_MCAST_TO_UCAST])
+               _print_onoff(f, "mcast_to_unicast", "mcast_to_unicast",
+                            rta_getattr_u8(tb[IFLA_BRPORT_MCAST_TO_UCAST]));
+
        if (tb[IFLA_BRPORT_NEIGH_SUPPRESS])
                _print_onoff(f, "neigh_suppress", "neigh_suppress",
                             rta_getattr_u8(tb[IFLA_BRPORT_NEIGH_SUPPRESS]));
@@ -267,7 +272,7 @@ static void bridge_slave_print_opt(struct link_util *lu, FILE *f,
 
                fwd_mask = rta_getattr_u16(tb[IFLA_BRPORT_GROUP_FWD_MASK]);
                print_0xhex(PRINT_ANY, "group_fwd_mask",
-                           "group_fwd_mask 0x%x ", fwd_mask);
+                           "group_fwd_mask %#llx ", fwd_mask);
                _bitmask2str(fwd_mask, convbuf, sizeof(convbuf), fwd_mask_tbl);
                print_string(PRINT_ANY, "group_fwd_mask_str",
                             "group_fwd_mask_str %s ", convbuf);
@@ -357,6 +362,10 @@ static int bridge_slave_parse_opt(struct link_util *lu, int argc, char **argv,
                        NEXT_ARG();
                        bridge_slave_parse_on_off("mcast_flood", *argv, n,
                                                  IFLA_BRPORT_MCAST_FLOOD);
+               } else if (matches(*argv, "mcast_to_unicast") == 0) {
+                       NEXT_ARG();
+                       bridge_slave_parse_on_off("mcast_to_unicast", *argv, n,
+                                                 IFLA_BRPORT_MCAST_TO_UCAST);
                } else if (matches(*argv, "proxy_arp") == 0) {
                        NEXT_ARG();
                        bridge_slave_parse_on_off("proxy_arp", *argv, n,