aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_westwood.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-04-29 19:20:58 -0400
committerDavid S. Miller <davem@davemloft.net>2015-05-05 19:50:09 -0400
commit31ccd0e66d41f73cfc21a8de976e713455205228 (patch)
treebaf576cd54720599d1834a2175bb07a71f005944 /net/ipv4/tcp_westwood.c
parent53ee1033ac1693d72f8c52e28f957697b021f6b4 (diff)
tcp_westwood: fix tcp_westwood_info()
I forgot to update tcp_westwood when changing get_info() behavior, this patch should fix this. Fixes: 64f40ff5bbdb ("tcp: prepare CC get_info() access from getsockopt()") Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_westwood.c')
-rw-r--r--net/ipv4/tcp_westwood.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/net/ipv4/tcp_westwood.c b/net/ipv4/tcp_westwood.c
index b3c57cceb990..c10732e39837 100644
--- a/net/ipv4/tcp_westwood.c
+++ b/net/ipv4/tcp_westwood.c
@@ -256,18 +256,19 @@ static void tcp_westwood_event(struct sock *sk, enum tcp_ca_event event)
256} 256}
257 257
258/* Extract info for Tcp socket info provided via netlink. */ 258/* Extract info for Tcp socket info provided via netlink. */
259static int tcp_westwood_info(struct sock *sk, u32 ext, struct sk_buff *skb) 259static size_t tcp_westwood_info(struct sock *sk, u32 ext, int *attr,
260 union tcp_cc_info *info)
260{ 261{
261 const struct westwood *ca = inet_csk_ca(sk); 262 const struct westwood *ca = inet_csk_ca(sk);
262 263
263 if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) { 264 if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
264 struct tcpvegas_info info = { 265 info->vegas.tcpv_enabled = 1;
265 .tcpv_enabled = 1, 266 info->vegas.tcpv_rttcnt = 0;
266 .tcpv_rtt = jiffies_to_usecs(ca->rtt), 267 info->vegas.tcpv_rtt = jiffies_to_usecs(ca->rtt),
267 .tcpv_minrtt = jiffies_to_usecs(ca->rtt_min), 268 info->vegas.tcpv_minrtt = jiffies_to_usecs(ca->rtt_min),
268 };
269 269
270 return nla_put(skb, INET_DIAG_VEGASINFO, sizeof(info), &info); 270 *attr = INET_DIAG_VEGASINFO;
271 return sizeof(struct tcpvegas_info);
271 } 272 }
272 return 0; 273 return 0;
273} 274}