summaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorSkylar Chang <chiaweic@codeaurora.org>2016-03-17 01:35:20 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:25:31 -0700
commit5a195b37dbbdae963636b9d86950307177e874f1 (patch)
treedce4f85085a1c1638e2ddfd35f0157290916194f /net/ipv4
parent58446132b1bcb6b940b73265b4de9f0230717c29 (diff)
cne: Add reference count for Smart Wireless Interface Manager
Add the reference count for Smart Wireless Interface Manager to know whether there are any process who still has the socket in question in use or not. Enable INET DIAG. Redefine the TCP_FLAG as it gives compiling error when an enum is defined by a function return. Change-Id: I1aa9c810fec2e332048c9ef4199ec3f996bc3a75 Signed-off-by: Chinh Tran <chinht@codeaurora.org> [chiaweic@codeaurora.org: resolve conflicts encountered with port to 4.4] Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index fea4961647ee..8398bb9c3503 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2724,6 +2724,14 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
rate = READ_ONCE(sk->sk_max_pacing_rate);
info->tcpi_max_pacing_rate = rate != ~0U ? rate : ~0ULL;
+ /* Expose reference count for socket */
+ if (sk->sk_socket) {
+ struct file *filep = sk->sk_socket->file;
+
+ if (filep)
+ info->tcpi_count = file_count(filep);
+ }
+
do {
start = u64_stats_fetch_begin_irq(&tp->syncp);
info->tcpi_bytes_acked = tp->bytes_acked;