[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100201080256.4084.30962.sendpatchset@localhost.localdomain>
Date: Mon, 1 Feb 2010 02:59:32 -0500
From: Amerigo Wang <amwang@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: netdev@...r.kernel.org, Amerigo Wang <amwang@...hat.com>,
David Miller <davem@...emloft.net>
Subject: [Patch] net: export TCP send buffer size via netlink
Currently, we can only get TCP send buffer size by
getsockopt (SO_SNDBUF or TCP_INFO), this is not enough
for the tools like netstat or ss to read.
Show TCP send buffer size via netlink NETLINK_INET_DIAG.
Signed-off-by: WANG Cong <amwang@...hat.com>
Cc: David Miller <davem@...emloft.net>
---
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 7fee8a4..46768de 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -136,6 +136,7 @@ struct tcp_info {
__u32 tcpi_ato;
__u32 tcpi_snd_mss;
__u32 tcpi_rcv_mss;
+ __u32 tcpi_sndbuf;
__u32 tcpi_unacked;
__u32 tcpi_sacked;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index b0a26bb..b3d6a62 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2385,6 +2385,7 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
info->tcpi_retransmits = icsk->icsk_retransmits;
info->tcpi_probes = icsk->icsk_probes_out;
info->tcpi_backoff = icsk->icsk_backoff;
+ info->tcpi_sndbuf = sk->sk_sndbuf;
if (tp->rx_opt.tstamp_ok)
info->tcpi_options |= TCPI_OPT_TIMESTAMPS;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists