]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
l2tp: no need to export session offsets in JSON output
authorGuillaume Nault <g.nault@alphalink.fr>
Thu, 5 Apr 2018 17:24:17 +0000 (19:24 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 5 Apr 2018 19:43:23 +0000 (12:43 -0700)
The offset and peer_offset parameters are only printed to avoid
confusing external scripts that may parse "ip l2tp show session"
output. There's no reason to keep them in JSON.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
ip/ipl2tp.c

index 427e02492a7c94c6dff2c8114df4435e07a73bba..05e9638725055c3bb509ecdc47235633a6496425 100644 (file)
@@ -306,8 +306,9 @@ static void print_session(struct l2tp_data *data)
                print_string(PRINT_FP, NULL, "%s", _SL_);
        }
 
-       print_uint(PRINT_ANY, "offset", "  offset %u,", 0);
-       print_uint(PRINT_ANY, "peer_offset", " peer offset %u\n", 0);
+       /* Show offsets only for plain console output (for legacy scripts) */
+       print_uint(PRINT_FP, "offset", "  offset %u,", 0);
+       print_uint(PRINT_FP, "peer_offset", " peer offset %u\n", 0);
 
        if (p->cookie_len > 0)
                print_cookie("cookie", "cookie",