aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-06-23 15:21:28 -0400
committerDavid S. Miller <davem@davemloft.net>2005-06-23 15:21:28 -0400
commit056ede6cface66b400cd3b8e60ed077cc5b85c18 (patch)
treecb9ac506ae90158a804f8998d3e3907bc7d487ce
parent7c99c909fa69a183c1b80bd64fb9f0d11459aff3 (diff)
[TCP]: Report congestion control algorithm in tcp_diag.
Enhancement to the tcp_diag interface used by the iproute2 ss command to report the tcp congestion control being used by a socket. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/tcp_diag.h4
-rw-r--r--net/ipv4/tcp_diag.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/tcp_diag.h b/include/linux/tcp_diag.h
index ceee962e1d15..7a5996743946 100644
--- a/include/linux/tcp_diag.h
+++ b/include/linux/tcp_diag.h
@@ -99,9 +99,10 @@ enum
99 TCPDIAG_MEMINFO, 99 TCPDIAG_MEMINFO,
100 TCPDIAG_INFO, 100 TCPDIAG_INFO,
101 TCPDIAG_VEGASINFO, 101 TCPDIAG_VEGASINFO,
102 TCPDIAG_CONG,
102}; 103};
103 104
104#define TCPDIAG_MAX TCPDIAG_VEGASINFO 105#define TCPDIAG_MAX TCPDIAG_CONG
105 106
106 107
107/* TCPDIAG_MEM */ 108/* TCPDIAG_MEM */
@@ -123,5 +124,4 @@ struct tcpvegas_info {
123 __u32 tcpv_minrtt; 124 __u32 tcpv_minrtt;
124}; 125};
125 126
126
127#endif /* _TCP_DIAG_H_ */ 127#endif /* _TCP_DIAG_H_ */
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index a4e512036d88..f66945cb158f 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -65,6 +65,11 @@ static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
65 if (ext & (1<<(TCPDIAG_INFO-1))) 65 if (ext & (1<<(TCPDIAG_INFO-1)))
66 info = TCPDIAG_PUT(skb, TCPDIAG_INFO, sizeof(*info)); 66 info = TCPDIAG_PUT(skb, TCPDIAG_INFO, sizeof(*info));
67 67
68 if (ext & (1<<(TCPDIAG_CONG-1))) {
69 size_t len = strlen(tp->ca_ops->name);
70 strcpy(TCPDIAG_PUT(skb, TCPDIAG_CONG, len+1),
71 tp->ca_ops->name);
72 }
68 } 73 }
69 r->tcpdiag_family = sk->sk_family; 74 r->tcpdiag_family = sk->sk_family;
70 r->tcpdiag_state = sk->sk_state; 75 r->tcpdiag_state = sk->sk_state;