Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22269
b: refs/heads/master
c: 2d0817d
h: refs/heads/master
i:
  22267: 2a79d8c
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Mar 21, 2006
1 parent f096d61 commit 787de6c
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 103 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: 110bae4efb5ed5565257a0fb9f6d26e6125a1c4b
refs/heads/master: 2d0817d11eaec57435feb61493331a763f732a2b
14 changes: 7 additions & 7 deletions trunk/net/dccp/ackvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,16 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb)
if (DCCP_SKB_CB(skb)->dccpd_opt_len + len > DCCP_MAX_OPT_LEN)
return -1;

avr = dccp_ackvec_record_new();
if (avr == NULL)
return -1;

dccp_timestamp(sk, &now);
elapsed_time = timeval_delta(&now, &av->dccpav_time) / 10;

if (elapsed_time != 0)
dccp_insert_option_elapsed_time(sk, skb, elapsed_time);
if (elapsed_time != 0 &&
dccp_insert_option_elapsed_time(sk, skb, elapsed_time))
return -1;

avr = dccp_ackvec_record_new();
if (avr == NULL)
return -1;

DCCP_SKB_CB(skb)->dccpd_opt_len += len;

Expand Down Expand Up @@ -310,7 +311,6 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk,
av->dccpav_buf_ackno = ackno;
dccp_timestamp(sk, &av->dccpav_time);
out:
dccp_pr_debug("");
return 0;

out_duplicate:
Expand Down
18 changes: 10 additions & 8 deletions trunk/net/dccp/ccid.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ struct ccid_operations {
unsigned char option,
unsigned char len, u16 idx,
unsigned char* value);
void (*ccid_hc_rx_insert_options)(struct sock *sk,
int (*ccid_hc_rx_insert_options)(struct sock *sk,
struct sk_buff *skb);
void (*ccid_hc_tx_insert_options)(struct sock *sk,
int (*ccid_hc_tx_insert_options)(struct sock *sk,
struct sk_buff *skb);
void (*ccid_hc_tx_packet_recv)(struct sock *sk,
struct sk_buff *skb);
Expand Down Expand Up @@ -146,18 +146,20 @@ static inline int ccid_hc_rx_parse_options(struct ccid *ccid, struct sock *sk,
return rc;
}

static inline void ccid_hc_tx_insert_options(struct ccid *ccid, struct sock *sk,
struct sk_buff *skb)
static inline int ccid_hc_tx_insert_options(struct ccid *ccid, struct sock *sk,
struct sk_buff *skb)
{
if (ccid->ccid_ops->ccid_hc_tx_insert_options != NULL)
ccid->ccid_ops->ccid_hc_tx_insert_options(sk, skb);
return ccid->ccid_ops->ccid_hc_tx_insert_options(sk, skb);
return 0;
}

static inline void ccid_hc_rx_insert_options(struct ccid *ccid, struct sock *sk,
struct sk_buff *skb)
static inline int ccid_hc_rx_insert_options(struct ccid *ccid, struct sock *sk,
struct sk_buff *skb)
{
if (ccid->ccid_ops->ccid_hc_rx_insert_options != NULL)
ccid->ccid_ops->ccid_hc_rx_insert_options(sk, skb);
return ccid->ccid_ops->ccid_hc_rx_insert_options(sk, skb);
return 0;
}

static inline void ccid_hc_rx_get_info(struct ccid *ccid, struct sock *sk,
Expand Down
37 changes: 20 additions & 17 deletions trunk/net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,15 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
}
}

static void ccid3_hc_tx_insert_options(struct sock *sk, struct sk_buff *skb)
static int ccid3_hc_tx_insert_options(struct sock *sk, struct sk_buff *skb)
{
const struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);

BUG_ON(hctx == NULL);

if (!(sk->sk_state == DCCP_OPEN || sk->sk_state == DCCP_PARTOPEN))
return;

DCCP_SKB_CB(skb)->dccpd_ccval = hctx->ccid3hctx_last_win_count;
if (sk->sk_state == DCCP_OPEN || sk->sk_state == DCCP_PARTOPEN)
DCCP_SKB_CB(skb)->dccpd_ccval = hctx->ccid3hctx_last_win_count;
return 0;
}

static int ccid3_hc_tx_parse_options(struct sock *sk, unsigned char option,
Expand Down Expand Up @@ -774,31 +773,35 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk)
dccp_send_ack(sk);
}

static void ccid3_hc_rx_insert_options(struct sock *sk, struct sk_buff *skb)
static int ccid3_hc_rx_insert_options(struct sock *sk, struct sk_buff *skb)
{
const struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk);
__be32 x_recv, pinv;

BUG_ON(hcrx == NULL);

if (!(sk->sk_state == DCCP_OPEN || sk->sk_state == DCCP_PARTOPEN))
return;
return 0;

DCCP_SKB_CB(skb)->dccpd_ccval = hcrx->ccid3hcrx_last_counter;

if (dccp_packet_without_ack(skb))
return;

if (hcrx->ccid3hcrx_elapsed_time != 0)
dccp_insert_option_elapsed_time(sk, skb,
hcrx->ccid3hcrx_elapsed_time);
dccp_insert_option_timestamp(sk, skb);
return 0;

x_recv = htonl(hcrx->ccid3hcrx_x_recv);
pinv = htonl(hcrx->ccid3hcrx_pinv);
dccp_insert_option(sk, skb, TFRC_OPT_LOSS_EVENT_RATE,
&pinv, sizeof(pinv));
dccp_insert_option(sk, skb, TFRC_OPT_RECEIVE_RATE,
&x_recv, sizeof(x_recv));

if ((hcrx->ccid3hcrx_elapsed_time != 0 &&
dccp_insert_option_elapsed_time(sk, skb,
hcrx->ccid3hcrx_elapsed_time)) ||
dccp_insert_option_timestamp(sk, skb) ||
dccp_insert_option(sk, skb, TFRC_OPT_LOSS_EVENT_RATE,
&pinv, sizeof(pinv)) ||
dccp_insert_option(sk, skb, TFRC_OPT_RECEIVE_RATE,
&x_recv, sizeof(x_recv)))
return -1;

return 0;
}

/* calculate first loss interval
Expand Down
8 changes: 4 additions & 4 deletions trunk/net/dccp/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,13 @@ static inline int dccp_ack_pending(const struct sock *sk)
inet_csk_ack_scheduled(sk);
}

extern void dccp_insert_options(struct sock *sk, struct sk_buff *skb);
extern void dccp_insert_option_elapsed_time(struct sock *sk,
extern int dccp_insert_options(struct sock *sk, struct sk_buff *skb);
extern int dccp_insert_option_elapsed_time(struct sock *sk,
struct sk_buff *skb,
u32 elapsed_time);
extern void dccp_insert_option_timestamp(struct sock *sk,
extern int dccp_insert_option_timestamp(struct sock *sk,
struct sk_buff *skb);
extern void dccp_insert_option(struct sock *sk, struct sk_buff *skb,
extern int dccp_insert_option(struct sock *sk, struct sk_buff *skb,
unsigned char option,
const void *value, unsigned char len);

Expand Down
Loading

0 comments on commit 787de6c

Please sign in to comment.