diff options
Diffstat (limited to 'net/ipv4/tcp_illinois.c')
| -rw-r--r-- | net/ipv4/tcp_illinois.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/net/ipv4/tcp_illinois.c b/net/ipv4/tcp_illinois.c index 67476f085e48..f71002e4db0b 100644 --- a/net/ipv4/tcp_illinois.c +++ b/net/ipv4/tcp_illinois.c | |||
| @@ -300,24 +300,25 @@ static u32 tcp_illinois_ssthresh(struct sock *sk) | |||
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | /* Extract info for Tcp socket info provided via netlink. */ | 302 | /* Extract info for Tcp socket info provided via netlink. */ |
| 303 | static int tcp_illinois_info(struct sock *sk, u32 ext, struct sk_buff *skb) | 303 | static size_t tcp_illinois_info(struct sock *sk, u32 ext, int *attr, |
| 304 | union tcp_cc_info *info) | ||
| 304 | { | 305 | { |
| 305 | const struct illinois *ca = inet_csk_ca(sk); | 306 | const struct illinois *ca = inet_csk_ca(sk); |
| 306 | 307 | ||
| 307 | if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) { | 308 | if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) { |
| 308 | struct tcpvegas_info info = { | 309 | info->vegas.tcpv_enabled = 1; |
| 309 | .tcpv_enabled = 1, | 310 | info->vegas.tcpv_rttcnt = ca->cnt_rtt; |
| 310 | .tcpv_rttcnt = ca->cnt_rtt, | 311 | info->vegas.tcpv_minrtt = ca->base_rtt; |
| 311 | .tcpv_minrtt = ca->base_rtt, | 312 | info->vegas.tcpv_rtt = 0; |
| 312 | }; | ||
| 313 | 313 | ||
| 314 | if (info.tcpv_rttcnt > 0) { | 314 | if (info->vegas.tcpv_rttcnt > 0) { |
| 315 | u64 t = ca->sum_rtt; | 315 | u64 t = ca->sum_rtt; |
| 316 | 316 | ||
| 317 | do_div(t, info.tcpv_rttcnt); | 317 | do_div(t, info->vegas.tcpv_rttcnt); |
| 318 | info.tcpv_rtt = t; | 318 | info->vegas.tcpv_rtt = t; |
| 319 | } | 319 | } |
| 320 | return nla_put(skb, INET_DIAG_VEGASINFO, sizeof(info), &info); | 320 | *attr = INET_DIAG_VEGASINFO; |
| 321 | return sizeof(struct tcpvegas_info); | ||
| 321 | } | 322 | } |
| 322 | return 0; | 323 | return 0; |
| 323 | } | 324 | } |
