Skip to content

Commit 31ccd0e

Browse files
Eric Dumazetdavem330
authored andcommitted
tcp_westwood: fix tcp_westwood_info()
I forgot to update tcp_westwood when changing get_info() behavior, this patch should fix this. Fixes: 64f40ff ("tcp: prepare CC get_info() access from getsockopt()") Reported-by: kbuild test robot <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Neal Cardwell <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 53ee103 commit 31ccd0e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

net/ipv4/tcp_westwood.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,18 +256,19 @@ static void tcp_westwood_event(struct sock *sk, enum tcp_ca_event event)
256256
}
257257

258258
/* Extract info for Tcp socket info provided via netlink. */
259-
static int tcp_westwood_info(struct sock *sk, u32 ext, struct sk_buff *skb)
259+
static size_t tcp_westwood_info(struct sock *sk, u32 ext, int *attr,
260+
union tcp_cc_info *info)
260261
{
261262
const struct westwood *ca = inet_csk_ca(sk);
262263

263264
if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
264-
struct tcpvegas_info info = {
265-
.tcpv_enabled = 1,
266-
.tcpv_rtt = jiffies_to_usecs(ca->rtt),
267-
.tcpv_minrtt = jiffies_to_usecs(ca->rtt_min),
268-
};
265+
info->vegas.tcpv_enabled = 1;
266+
info->vegas.tcpv_rttcnt = 0;
267+
info->vegas.tcpv_rtt = jiffies_to_usecs(ca->rtt),
268+
info->vegas.tcpv_minrtt = jiffies_to_usecs(ca->rtt_min),
269269

270-
return nla_put(skb, INET_DIAG_VEGASINFO, sizeof(info), &info);
270+
*attr = INET_DIAG_VEGASINFO;
271+
return sizeof(struct tcpvegas_info);
271272
}
272273
return 0;
273274
}

0 commit comments

Comments
 (0)