* [PATCH net v2] mptcp: print new line in mptcp_seq_show() if mptcp isn't in use
@ 2020-12-05 7:56 Jianguo Wu
2020-12-08 1:46 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Jianguo Wu @ 2020-12-05 7:56 UTC (permalink / raw)
To: Jakub Kicinski, Florian Westphal
Cc: netdev, mathew.j.martineau, pabeni, davem
From: Jianguo Wu <wujianguo@chinatelecom.cn>
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>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net v2] mptcp: print new line in mptcp_seq_show() if mptcp isn't in use
2020-12-05 7:56 [PATCH net v2] mptcp: print new line in mptcp_seq_show() if mptcp isn't in use Jianguo Wu
@ 2020-12-08 1:46 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2020-12-08 1:46 UTC (permalink / raw)
To: Jianguo Wu; +Cc: Florian Westphal, netdev, mathew.j.martineau, pabeni, davem
On Sat, 5 Dec 2020 15:56:33 +0800 Jianguo Wu wrote:
> From: Jianguo Wu <wujianguo@chinatelecom.cn>
>
> 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>
Applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-08 1:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-05 7:56 [PATCH net v2] mptcp: print new line in mptcp_seq_show() if mptcp isn't in use Jianguo Wu
2020-12-08 1:46 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).