summaryrefslogtreecommitdiff
path: root/net/mptcp/mib.c
diff options
context:
space:
mode:
authorJianguo Wu <wujianguo@chinatelecom.cn>2020-12-05 15:56:33 +0800
committerJakub Kicinski <kuba@kernel.org>2020-12-07 17:45:29 -0800
commitf55628b3e7648198e9c072b52080c5dea8678adf (patch)
tree9d83caa9c2eb043176e182c9dab6d3b32561dc20 /net/mptcp/mib.c
parent851d0a73c90e6c8c63fef106c6c1e73df7e05d9d (diff)
mptcp: print new line in mptcp_seq_show() if mptcp isn't in use
When do cat /proc/net/netstat, the output isn't append with a new line, it looks like this: [root@localhost ~]# cat /proc/net/netstat ... MPTcpExt: 0 0 0 0 0 0 0 0 0 0 0 0 0[root@localhost ~]# This is because in mptcp_seq_show(), if mptcp isn't in use, net->mib.mptcp_statistics is NULL, so it just puts all 0 after "MPTcpExt:", and return, forgot the '\n'. After this patch: [root@localhost ~]# cat /proc/net/netstat ... MPTcpExt: 0 0 0 0 0 0 0 0 0 0 0 0 0 [root@localhost ~]# Fixes: fc518953bc9c8d7d ("mptcp: add and use MIB counter infrastructure") Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn> Acked-by: Florian Westphal <fw@strlen.de> Link: https://lore.kernel.org/r/142e2fd9-58d9-bb13-fb75-951cccc2331e@163.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/mptcp/mib.c')
-rw-r--r--net/mptcp/mib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/mptcp/mib.c b/net/mptcp/mib.c
index 84d119436b22..b921cbdd9aaa 100644
--- a/net/mptcp/mib.c
+++ b/net/mptcp/mib.c
@@ -67,6 +67,7 @@ void mptcp_seq_show(struct seq_file *seq)
for (i = 0; mptcp_snmp_list[i].name; i++)
seq_puts(seq, " 0");
+ seq_putc(seq, '\n');
return;
}