]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iprule: Fix destination prefix output
authorStefan Bader <stefan.bader@canonical.com>
Tue, 28 Aug 2018 14:27:29 +0000 (16:27 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 30 Aug 2018 14:51:00 +0000 (07:51 -0700)
When adding support for JSON output the new code for printing
the destination prefix adds a stray blank character before
the bitmask. This causes some user-space parsing to fail.

Current output:
  ...: from x.x.x.x/l to y.y.y.y /l
Previous output:
  ...: from x.x.x.x/l to y.y.y.y/l

Fixes: 0dd4ccc5 "iprule: add json support"
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iprule.c

index 8b9421431c26adc77d8bd32dd3e6970095f4f76d..744d6d88e3433525b7a739ee5fcfbfc09979a64e 100644 (file)
@@ -239,7 +239,7 @@ int print_rule(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
 
                print_string(PRINT_FP, NULL, "to ", NULL);
                print_color_string(PRINT_ANY, ifa_family_color(frh->family),
-                                  "dst", "%s ", dst);
+                                  "dst", "%s", dst);
                if (frh->dst_len != host_len)
                        print_uint(PRINT_ANY, "dstlen", "/%u ", frh->dst_len);
                else