aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/ccid3.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ccids/ccid3.c')
-rw-r--r--net/dccp/ccids/ccid3.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index cd9b9ffe2ec4..e31560daa0b9 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -917,6 +917,7 @@ static int ccid3_hc_rx_getsockopt(struct sock *sk, const int optname, int len,
917 u32 __user *optval, int __user *optlen) 917 u32 __user *optval, int __user *optlen)
918{ 918{
919 const struct ccid3_hc_rx_sock *hcrx; 919 const struct ccid3_hc_rx_sock *hcrx;
920 struct tfrc_rx_info rx_info;
920 const void *val; 921 const void *val;
921 922
922 /* Listen socks doesn't have a private CCID block */ 923 /* Listen socks doesn't have a private CCID block */
@@ -926,10 +927,14 @@ static int ccid3_hc_rx_getsockopt(struct sock *sk, const int optname, int len,
926 hcrx = ccid3_hc_rx_sk(sk); 927 hcrx = ccid3_hc_rx_sk(sk);
927 switch (optname) { 928 switch (optname) {
928 case DCCP_SOCKOPT_CCID_RX_INFO: 929 case DCCP_SOCKOPT_CCID_RX_INFO:
929 if (len < sizeof(hcrx->ccid3hcrx_tfrc)) 930 if (len < sizeof(rx_info))
930 return -EINVAL; 931 return -EINVAL;
931 len = sizeof(hcrx->ccid3hcrx_tfrc); 932 rx_info.tfrcrx_x_recv = hcrx->ccid3hcrx_x_recv;
932 val = &hcrx->ccid3hcrx_tfrc; 933 rx_info.tfrcrx_rtt = hcrx->ccid3hcrx_rtt;
934 rx_info.tfrcrx_p = hcrx->ccid3hcrx_pinv == 0 ? ~0U :
935 scaled_div(1, hcrx->ccid3hcrx_pinv);
936 len = sizeof(rx_info);
937 val = &rx_info;
933 break; 938 break;
934 default: 939 default:
935 return -ENOPROTOOPT; 940 return -ENOPROTOOPT;