]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: print new line in mptcp_seq_show() if mptcp isn't in use
authorJianguo Wu <wujianguo@chinatelecom.cn>
Sat, 5 Dec 2020 07:56:33 +0000 (15:56 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 8 Dec 2020 01:45:29 +0000 (17:45 -0800)
commit8b1502017376181c3b88428d48f098a24ff25b80
tree9d83caa9c2eb043176e182c9dab6d3b32561dc20
parentc5ba56920216abf03af174983d4a1431387bad12
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: 01bdddab11375de0 ("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>
net/mptcp/mib.c