[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <142e2fd9-58d9-bb13-fb75-951cccc2331e@163.com>
Date: Sat, 5 Dec 2020 15:56:33 +0800
From: Jianguo Wu <wujianguo106@....com>
To: Jakub Kicinski <kuba@...nel.org>, Florian Westphal <fw@...len.de>
Cc: netdev@...r.kernel.org, mathew.j.martineau@...ux.intel.com,
pabeni@...hat.com, davem@...emloft.net
Subject: [PATCH net v2] mptcp: print new line in mptcp_seq_show() if mptcp
isn't in use
From: Jianguo Wu <wujianguo@...natelecom.cn>
When do cat /proc/net/netstat, the output isn't append with a new line, it looks like this:
[root@...alhost ~]# cat /proc/net/netstat
...
MPTcpExt: 0 0 0 0 0 0 0 0 0 0 0 0 0[root@...alhost ~]#
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@...alhost ~]# cat /proc/net/netstat
...
MPTcpExt: 0 0 0 0 0 0 0 0 0 0 0 0 0
[root@...alhost ~]#
Fixes: fc518953bc9c8d7d ("mptcp: add and use MIB counter infrastructure")
Signed-off-by: Jianguo Wu <wujianguo@...natelecom.cn>
Acked-by: Florian Westphal <fw@...len.de>
---
net/mptcp/mib.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/mptcp/mib.c b/net/mptcp/mib.c
index 84d1194..b921cbd 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;
}
--
1.8.3.1
Powered by blists - more mailing lists