]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
iprule: avoid trailing space in print_rule() after printing protocol
authorThomas Haller <thaller@redhat.com>
Tue, 23 Apr 2019 07:16:13 +0000 (09:16 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 24 Apr 2019 22:06:15 +0000 (15:06 -0700)
It seems print_rule() tries to avoid a trailing space at the end
of the line. At least, when printing details about the actions,
they no longer append the space. Probably expecting to be the
last attribute that will be printed.

Don't let the protocol add the trailing space. The space at the end
of the line should be printed consistently (or not).

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iprule.c

index 2479c3abb66be2b803123baeb3ae633cc0d1b9db..ce6b7cd3472b8d3de4dc0cfd2601ba8d4dba6397 100644 (file)
@@ -468,7 +468,7 @@ int print_rule(struct nlmsghdr *n, void *arg)
                __u8 protocol = rta_getattr_u8(tb[FRA_PROTOCOL]);
 
                if ((protocol && protocol != RTPROT_KERNEL) || show_details > 0) {
-                       print_string(PRINT_ANY, "protocol", " proto %s ",
+                       print_string(PRINT_ANY, "protocol", " proto %s",
                                     rtnl_rtprot_n2a(protocol, b1, sizeof(b1)));
                }
        }