]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
bonding: export 3ad actor and partner port state
authorNikolay Aleksandrov <razor@blackwall.org>
Tue, 16 Jun 2015 09:26:57 +0000 (12:26 +0300)
committerStephen Hemminger <shemming@brocade.com>
Fri, 26 Jun 2015 04:06:45 +0000 (00:06 -0400)
This patch adds support to retrieve the new bond slave attributes:
IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE
IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE
which are read-only.

(Removed if_link.h changes already updated in net-next)

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
ip/iplink_bond_slave.c

index aacba14aef9cc3b971a71ce3171025d63b2df355..33bea9132b78834990ae167bfa6c46aaaadcdc34 100644 (file)
@@ -78,6 +78,14 @@ static void bond_slave_print_opt(struct link_util *lu, FILE *f, struct rtattr *t
        if (tb[IFLA_BOND_SLAVE_AD_AGGREGATOR_ID])
                fprintf(f, "ad_aggregator_id %d ",
                        rta_getattr_u16(tb[IFLA_BOND_SLAVE_AD_AGGREGATOR_ID]));
+
+       if (tb[IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE])
+               fprintf(f, "ad_actor_oper_port_state %d\n",
+                       rta_getattr_u8(tb[IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE]));
+
+       if (tb[IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE])
+               fprintf(f, "ad_partner_oper_port_state %d\n",
+                       rta_getattr_u16(tb[IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE]));
 }
 
 static int bond_slave_parse_opt(struct link_util *lu, int argc, char **argv,