Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111255
b: refs/heads/master
c: 4d40555
h: refs/heads/master
i:
  111253: 8fa51fa
  111251: 5b1cdd0
  111247: e458645
v: v3
  • Loading branch information
David S. Miller committed Aug 27, 2008
1 parent 74a574b commit ff790e0
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 13 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: 7fd106785104fa19709fa136abb64c7a9d5db285
refs/heads/master: 4d40555250320520c5398569457962b3984fc75e
2 changes: 1 addition & 1 deletion trunk/net/dccp/ccids/ccid2.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ static struct ccid_operations ccid2 = {
};

#ifdef CONFIG_IP_DCCP_CCID2_DEBUG
module_param(ccid2_debug, bool, 0444);
module_param(ccid2_debug, bool, 0644);
MODULE_PARM_DESC(ccid2_debug, "Enable debug messages");
#endif

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ static struct ccid_operations ccid3 = {
};

#ifdef CONFIG_IP_DCCP_CCID3_DEBUG
module_param(ccid3_debug, bool, 0444);
module_param(ccid3_debug, bool, 0644);
MODULE_PARM_DESC(ccid3_debug, "Enable debug messages");
#endif

Expand Down
6 changes: 4 additions & 2 deletions trunk/net/dccp/ccids/lib/loss_interval.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ static void tfrc_lh_calc_i_mean(struct tfrc_loss_hist *lh)
u32 i_i, i_tot0 = 0, i_tot1 = 0, w_tot = 0;
int i, k = tfrc_lh_length(lh) - 1; /* k is as in rfc3448bis, 5.4 */

for (i=0; i <= k; i++) {
if (k <= 0)
return;

for (i = 0; i <= k; i++) {
i_i = tfrc_lh_get_interval(lh, i);

if (i < k) {
Expand All @@ -78,7 +81,6 @@ static void tfrc_lh_calc_i_mean(struct tfrc_loss_hist *lh)
i_tot1 += i_i * tfrc_lh_weights[i-1];
}

BUG_ON(w_tot == 0);
lh->i_mean = max(i_tot0, i_tot1) / w_tot;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/dccp/ccids/lib/tfrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#ifdef CONFIG_IP_DCCP_TFRC_DEBUG
int tfrc_debug;
module_param(tfrc_debug, bool, 0444);
module_param(tfrc_debug, bool, 0644);
MODULE_PARM_DESC(tfrc_debug, "Enable debug messages");
#endif

Expand Down
4 changes: 2 additions & 2 deletions trunk/net/dccp/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
goto discard;

if (dccp_parse_options(sk, NULL, skb))
goto discard;
return 1;

if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ)
dccp_event_ack_recv(sk, skb);
Expand Down Expand Up @@ -610,7 +610,7 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
* Step 8: Process options and mark acknowledgeable
*/
if (dccp_parse_options(sk, NULL, skb))
goto discard;
return 1;

if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ)
dccp_event_ack_recv(sk, skb);
Expand Down
13 changes: 9 additions & 4 deletions trunk/net/dccp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
/* Check if this isn't a single byte option */
if (opt > DCCPO_MAX_RESERVED) {
if (opt_ptr == opt_end)
goto out_invalid_option;
goto out_nonsensical_length;

len = *opt_ptr++;
if (len < 3)
goto out_invalid_option;
if (len < 2)
goto out_nonsensical_length;
/*
* Remove the type and len fields, leaving
* just the value size
Expand All @@ -95,7 +95,7 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
opt_ptr += len;

if (opt_ptr > opt_end)
goto out_invalid_option;
goto out_nonsensical_length;
}

/*
Expand Down Expand Up @@ -283,12 +283,17 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
if (mandatory)
goto out_invalid_option;

out_nonsensical_length:
/* RFC 4340, 5.8: ignore option and all remaining option space */
return 0;

out_invalid_option:
DCCP_INC_STATS_BH(DCCP_MIB_INVALIDOPT);
DCCP_SKB_CB(skb)->dccpd_reset_code = DCCP_RESET_CODE_OPTION_ERROR;
DCCP_WARN("DCCP(%p): invalid option %d, len=%d", sk, opt, len);
DCCP_SKB_CB(skb)->dccpd_reset_data[0] = opt;
DCCP_SKB_CB(skb)->dccpd_reset_data[1] = len > 0 ? value[0] : 0;
DCCP_SKB_CB(skb)->dccpd_reset_data[2] = len > 1 ? value[1] : 0;
return -1;
}

Expand Down
4 changes: 3 additions & 1 deletion trunk/net/dccp/proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ int dccp_disconnect(struct sock *sk, int flags)
sk->sk_err = ECONNRESET;

dccp_clear_xmit_timers(sk);

__skb_queue_purge(&sk->sk_receive_queue);
__skb_queue_purge(&sk->sk_write_queue);
if (sk->sk_send_head != NULL) {
__kfree_skb(sk->sk_send_head);
sk->sk_send_head = NULL;
Expand Down Expand Up @@ -1028,7 +1030,7 @@ MODULE_PARM_DESC(thash_entries, "Number of ehash buckets");

#ifdef CONFIG_IP_DCCP_DEBUG
int dccp_debug;
module_param(dccp_debug, bool, 0444);
module_param(dccp_debug, bool, 0644);
MODULE_PARM_DESC(dccp_debug, "Enable debug messages");

EXPORT_SYMBOL_GPL(dccp_debug);
Expand Down

0 comments on commit ff790e0

Please sign in to comment.