]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ss: mptcp: display info counters as unsigned
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Wed, 23 Aug 2023 07:24:06 +0000 (09:24 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 23 Aug 2023 15:10:34 +0000 (08:10 -0700)
Some counters from mptcp_info structure were stored as an unsigned
number (u8) but displayed as a signed one.

Even if it is unlikely these u8 counters -- number of subflows and
ADD_ADDR -- have a value bigger than 2^7, it still sounds better to
display them as unsigned.

Fixes: 9c3be2c0 ("ss: mptcp: add msk diag interface support")
Acked-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
misc/ss.c

index 653b1512c6ba71a8c2301ce7d1a8789e6ad8c878..7ce73e610c515189d93ffd1c532641de99bc72e9 100644 (file)
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -3232,17 +3232,17 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
 static void mptcp_stats_print(struct mptcp_info *s)
 {
        if (s->mptcpi_subflows)
-               out(" subflows:%d", s->mptcpi_subflows);
+               out(" subflows:%u", s->mptcpi_subflows);
        if (s->mptcpi_add_addr_signal)
-               out(" add_addr_signal:%d", s->mptcpi_add_addr_signal);
+               out(" add_addr_signal:%u", s->mptcpi_add_addr_signal);
        if (s->mptcpi_add_addr_accepted)
-               out(" add_addr_accepted:%d", s->mptcpi_add_addr_accepted);
+               out(" add_addr_accepted:%u", s->mptcpi_add_addr_accepted);
        if (s->mptcpi_subflows_max)
-               out(" subflows_max:%d", s->mptcpi_subflows_max);
+               out(" subflows_max:%u", s->mptcpi_subflows_max);
        if (s->mptcpi_add_addr_signal_max)
-               out(" add_addr_signal_max:%d", s->mptcpi_add_addr_signal_max);
+               out(" add_addr_signal_max:%u", s->mptcpi_add_addr_signal_max);
        if (s->mptcpi_add_addr_accepted_max)
-               out(" add_addr_accepted_max:%d", s->mptcpi_add_addr_accepted_max);
+               out(" add_addr_accepted_max:%u", s->mptcpi_add_addr_accepted_max);
        if (s->mptcpi_flags & MPTCP_INFO_FLAG_FALLBACK)
                out(" fallback");
        if (s->mptcpi_flags & MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED)