Commit 056ede6c authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[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: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7c99c909
...@@ -99,9 +99,10 @@ enum ...@@ -99,9 +99,10 @@ enum
TCPDIAG_MEMINFO, TCPDIAG_MEMINFO,
TCPDIAG_INFO, TCPDIAG_INFO,
TCPDIAG_VEGASINFO, TCPDIAG_VEGASINFO,
TCPDIAG_CONG,
}; };
#define TCPDIAG_MAX TCPDIAG_VEGASINFO #define TCPDIAG_MAX TCPDIAG_CONG
/* TCPDIAG_MEM */ /* TCPDIAG_MEM */
...@@ -123,5 +124,4 @@ struct tcpvegas_info { ...@@ -123,5 +124,4 @@ struct tcpvegas_info {
__u32 tcpv_minrtt; __u32 tcpv_minrtt;
}; };
#endif /* _TCP_DIAG_H_ */ #endif /* _TCP_DIAG_H_ */
...@@ -65,6 +65,11 @@ static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk, ...@@ -65,6 +65,11 @@ static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
if (ext & (1<<(TCPDIAG_INFO-1))) if (ext & (1<<(TCPDIAG_INFO-1)))
info = TCPDIAG_PUT(skb, TCPDIAG_INFO, sizeof(*info)); info = TCPDIAG_PUT(skb, TCPDIAG_INFO, sizeof(*info));
if (ext & (1<<(TCPDIAG_CONG-1))) {
size_t len = strlen(tp->ca_ops->name);
strcpy(TCPDIAG_PUT(skb, TCPDIAG_CONG, len+1),
tp->ca_ops->name);
}
} }
r->tcpdiag_family = sk->sk_family; r->tcpdiag_family = sk->sk_family;
r->tcpdiag_state = sk->sk_state; r->tcpdiag_state = sk->sk_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment