netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] iplink: bond_slave: fix ad_actor/partner_oper_port_state output
@ 2016-02-08 16:13 Nikolay Aleksandrov
  2016-02-08 20:56 ` Nikolay Aleksandrov
  2016-02-09 17:21 ` Stephen Hemminger
  0 siblings, 2 replies; 3+ messages in thread
From: Nikolay Aleksandrov @ 2016-02-08 16:13 UTC (permalink / raw)
  To: netdev; +Cc: stannous, roopa, stephen, Nikolay Aleksandrov

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

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")
Reported-by: Sam Tannous <stannous@cumulusnetworks.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
 ip/iplink_bond_slave.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ip/iplink_bond_slave.c b/ip/iplink_bond_slave.c
index 9b569b1daa4e..2f3364ee45a5 100644
--- a/ip/iplink_bond_slave.c
+++ b/ip/iplink_bond_slave.c
@@ -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]));
 }
 
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2] iplink: bond_slave: fix ad_actor/partner_oper_port_state output
  2016-02-08 16:13 [PATCH iproute2] iplink: bond_slave: fix ad_actor/partner_oper_port_state output Nikolay Aleksandrov
@ 2016-02-08 20:56 ` Nikolay Aleksandrov
  2016-02-09 17:21 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Nikolay Aleksandrov @ 2016-02-08 20:56 UTC (permalink / raw)
  To: Nikolay Aleksandrov, netdev; +Cc: stannous, roopa, stephen

On 02/08/2016 05:13 PM, Nikolay Aleksandrov wrote:
> From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> 
> 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")
> Reported-by: Sam Tannous <stannous@cumulusnetworks.com>
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> ---
>  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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2] iplink: bond_slave: fix ad_actor/partner_oper_port_state output
  2016-02-08 16:13 [PATCH iproute2] iplink: bond_slave: fix ad_actor/partner_oper_port_state output Nikolay Aleksandrov
  2016-02-08 20:56 ` Nikolay Aleksandrov
@ 2016-02-09 17:21 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2016-02-09 17:21 UTC (permalink / raw)
  To: Nikolay Aleksandrov; +Cc: netdev, stannous, roopa, Nikolay Aleksandrov

On Mon,  8 Feb 2016 17:13:58 +0100
Nikolay Aleksandrov <razor@blackwall.org> wrote:

> From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> 
> 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")
> Reported-by: Sam Tannous <stannous@cumulusnetworks.com>
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Applied

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-09 17:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-08 16:13 [PATCH iproute2] iplink: bond_slave: fix ad_actor/partner_oper_port_state output Nikolay Aleksandrov
2016-02-08 20:56 ` Nikolay Aleksandrov
2016-02-09 17:21 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).