Skip to contentSkip to conversation

iplink: bond_slave: fix ad_actor/partner_oper_port_state output

PATCH Applied Nikolay Aleksandrov 3 participants 3 messages Feb 8, 2016 – Feb 9, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iplink: bond_slave: fix ad_actor/partner_oper_port_state output

From: Nikolay Aleksandrov <[email protected]>

It seems that I've made a mistake when I exported these, instead of a space in the end I've put a newline character which is wrong and breaks the single line output.

Fixes 7d6bc3b87abad ("bonding: export 3ad actor and partner port state")
---
 ip/iplink_bond_slave.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
ip/iplink_bond_slave.c +2 -2
index 9b569b1daa4e..2f3364ee45a5 100644
@@ -80,11 +80,11 @@ static void bond_slave_print_opt(struct link_util *lu, FILE *f, struct rtattr *t
 			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",
+		fprintf(f, "ad_actor_oper_port_state %d ",
 			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",
+		fprintf(f, "ad_partner_oper_port_state %d ",
 			rta_getattr_u16(tb[IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE]));
 }
 
Signature · 1 line
2.4.3
#1 lore raw
Quoted 6 lines · Nikolay Aleksandrov

From: Nikolay Aleksandrov <[email protected]>

It seems that I've made a mistake when I exported these, instead of a space in the end I've put a newline character which is wrong and breaks the single line output.

Quoted 7 lines
Fixes 7d6bc3b87abad ("bonding: export 3ad actor and partner port state")
---
 ip/iplink_bond_slave.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I'm not sure if this patch is appropriate as there might be scripts that already parse it like this (with newline at the end). So if it's not acceptable I can suggest a different approach where iplink_bond_slave will account for the "oneline" argument and only then print it with a space so people will have an option. But currently this breaks the one line "way" of printing that all other iplink users are doing.

#2 lore raw
In reply to Nikolay Aleksandrov
Quoted 9 lines · On Mon, 8 Feb 2016 17:13:58 +0100 Nikolay Aleksandrov <[email protected]>…

From: Nikolay Aleksandrov <[email protected]>

It seems that I've made a mistake when I exported these, instead of a space in the end I've put a newline character which is wrong and breaks the single line output.

Fixes 7d6bc3b87abad ("bonding: export 3ad actor and partner port state")

Applied