Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78487
b: refs/heads/master
c: 8e138e7
h: refs/heads/master
i:
  78485: 82fb8a7
  78483: 8d24fde
  78479: 16d6dec
v: v3
  • Loading branch information
Gerrit Renker authored and David S. Miller committed Jan 28, 2008
1 parent 870c883 commit 2559456
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 17159b0b494ad27f397f914d6eab1b91faf57630
refs/heads/master: 8e138e7949490eebdccbd65b1f660a0488149a6b
11 changes: 8 additions & 3 deletions trunk/net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,7 @@ static int ccid3_hc_rx_getsockopt(struct sock *sk, const int optname, int len,
u32 __user *optval, int __user *optlen)
{
const struct ccid3_hc_rx_sock *hcrx;
struct tfrc_rx_info rx_info;
const void *val;

/* Listen socks doesn't have a private CCID block */
Expand All @@ -926,10 +927,14 @@ static int ccid3_hc_rx_getsockopt(struct sock *sk, const int optname, int len,
hcrx = ccid3_hc_rx_sk(sk);
switch (optname) {
case DCCP_SOCKOPT_CCID_RX_INFO:
if (len < sizeof(hcrx->ccid3hcrx_tfrc))
if (len < sizeof(rx_info))
return -EINVAL;
len = sizeof(hcrx->ccid3hcrx_tfrc);
val = &hcrx->ccid3hcrx_tfrc;
rx_info.tfrcrx_x_recv = hcrx->ccid3hcrx_x_recv;
rx_info.tfrcrx_rtt = hcrx->ccid3hcrx_rtt;
rx_info.tfrcrx_p = hcrx->ccid3hcrx_pinv == 0 ? ~0U :
scaled_div(1, hcrx->ccid3hcrx_pinv);
len = sizeof(rx_info);
val = &rx_info;
break;
default:
return -ENOPROTOOPT;
Expand Down
8 changes: 4 additions & 4 deletions trunk/net/dccp/ccids/ccid3.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ enum ccid3_hc_rx_states {
* @ccid3hcrx_last_counter - Tracks window counter (RFC 4342, 8.1)
* @ccid3hcrx_state - Receiver state, one of %ccid3_hc_rx_states
* @ccid3hcrx_bytes_recv - Total sum of DCCP payload bytes
* @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448, sec. 4.3)
* @ccid3hcrx_rtt - Receiver estimate of RTT
* @ccid3hcrx_tstamp_last_feedback - Time at which last feedback was sent
* @ccid3hcrx_tstamp_last_ack - Time at which last feedback was sent
* @ccid3hcrx_hist - Packet history (loss detection + RTT sampling)
Expand All @@ -147,13 +149,11 @@ enum ccid3_hc_rx_states {
* @ccid3hcrx_pinv - Inverse of Loss Event Rate (RFC 4342, sec. 8.5)
*/
struct ccid3_hc_rx_sock {
struct tfrc_rx_info ccid3hcrx_tfrc;
#define ccid3hcrx_x_recv ccid3hcrx_tfrc.tfrcrx_x_recv
#define ccid3hcrx_rtt ccid3hcrx_tfrc.tfrcrx_rtt
#define ccid3hcrx_p ccid3hcrx_tfrc.tfrcrx_p
u8 ccid3hcrx_last_counter:4;
enum ccid3_hc_rx_states ccid3hcrx_state:8;
u32 ccid3hcrx_bytes_recv;
u32 ccid3hcrx_x_recv;
u32 ccid3hcrx_rtt;
ktime_t ccid3hcrx_tstamp_last_feedback;
struct tfrc_rx_hist ccid3hcrx_hist;
struct tfrc_loss_hist ccid3hcrx_li_hist;
Expand Down

0 comments on commit 2559456

Please sign in to comment.