diff options
-rw-r--r-- | net/dccp/ccids/ccid2.c | 2 | ||||
-rw-r--r-- | net/dccp/ccids/ccid3.c | 2 | ||||
-rw-r--r-- | net/dccp/ccids/lib/loss_interval.c | 6 | ||||
-rw-r--r-- | net/dccp/ccids/lib/tfrc.c | 2 | ||||
-rw-r--r-- | net/dccp/input.c | 4 | ||||
-rw-r--r-- | net/dccp/options.c | 13 | ||||
-rw-r--r-- | net/dccp/proto.c | 4 |
7 files changed, 21 insertions, 12 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index 8e9580874216..9a430734530c 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c | |||
@@ -783,7 +783,7 @@ static struct ccid_operations ccid2 = { | |||
783 | }; | 783 | }; |
784 | 784 | ||
785 | #ifdef CONFIG_IP_DCCP_CCID2_DEBUG | 785 | #ifdef CONFIG_IP_DCCP_CCID2_DEBUG |
786 | module_param(ccid2_debug, bool, 0444); | 786 | module_param(ccid2_debug, bool, 0644); |
787 | MODULE_PARM_DESC(ccid2_debug, "Enable debug messages"); | 787 | MODULE_PARM_DESC(ccid2_debug, "Enable debug messages"); |
788 | #endif | 788 | #endif |
789 | 789 | ||
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index f6756e0c9e69..3b8bd7ca6761 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -963,7 +963,7 @@ static struct ccid_operations ccid3 = { | |||
963 | }; | 963 | }; |
964 | 964 | ||
965 | #ifdef CONFIG_IP_DCCP_CCID3_DEBUG | 965 | #ifdef CONFIG_IP_DCCP_CCID3_DEBUG |
966 | module_param(ccid3_debug, bool, 0444); | 966 | module_param(ccid3_debug, bool, 0644); |
967 | MODULE_PARM_DESC(ccid3_debug, "Enable debug messages"); | 967 | MODULE_PARM_DESC(ccid3_debug, "Enable debug messages"); |
968 | #endif | 968 | #endif |
969 | 969 | ||
diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c index bcd6ac415bb9..5b3ce0688c5c 100644 --- a/net/dccp/ccids/lib/loss_interval.c +++ b/net/dccp/ccids/lib/loss_interval.c | |||
@@ -67,7 +67,10 @@ static void tfrc_lh_calc_i_mean(struct tfrc_loss_hist *lh) | |||
67 | u32 i_i, i_tot0 = 0, i_tot1 = 0, w_tot = 0; | 67 | u32 i_i, i_tot0 = 0, i_tot1 = 0, w_tot = 0; |
68 | int i, k = tfrc_lh_length(lh) - 1; /* k is as in rfc3448bis, 5.4 */ | 68 | int i, k = tfrc_lh_length(lh) - 1; /* k is as in rfc3448bis, 5.4 */ |
69 | 69 | ||
70 | for (i=0; i <= k; i++) { | 70 | if (k <= 0) |
71 | return; | ||
72 | |||
73 | for (i = 0; i <= k; i++) { | ||
71 | i_i = tfrc_lh_get_interval(lh, i); | 74 | i_i = tfrc_lh_get_interval(lh, i); |
72 | 75 | ||
73 | if (i < k) { | 76 | if (i < k) { |
@@ -78,7 +81,6 @@ static void tfrc_lh_calc_i_mean(struct tfrc_loss_hist *lh) | |||
78 | i_tot1 += i_i * tfrc_lh_weights[i-1]; | 81 | i_tot1 += i_i * tfrc_lh_weights[i-1]; |
79 | } | 82 | } |
80 | 83 | ||
81 | BUG_ON(w_tot == 0); | ||
82 | lh->i_mean = max(i_tot0, i_tot1) / w_tot; | 84 | lh->i_mean = max(i_tot0, i_tot1) / w_tot; |
83 | } | 85 | } |
84 | 86 | ||
diff --git a/net/dccp/ccids/lib/tfrc.c b/net/dccp/ccids/lib/tfrc.c index 97ecec0a8e76..185916218e07 100644 --- a/net/dccp/ccids/lib/tfrc.c +++ b/net/dccp/ccids/lib/tfrc.c | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #ifdef CONFIG_IP_DCCP_TFRC_DEBUG | 11 | #ifdef CONFIG_IP_DCCP_TFRC_DEBUG |
12 | int tfrc_debug; | 12 | int tfrc_debug; |
13 | module_param(tfrc_debug, bool, 0444); | 13 | module_param(tfrc_debug, bool, 0644); |
14 | MODULE_PARM_DESC(tfrc_debug, "Enable debug messages"); | 14 | MODULE_PARM_DESC(tfrc_debug, "Enable debug messages"); |
15 | #endif | 15 | #endif |
16 | 16 | ||
diff --git a/net/dccp/input.c b/net/dccp/input.c index 803933ab396d..779d0ed9ae94 100644 --- a/net/dccp/input.c +++ b/net/dccp/input.c | |||
@@ -370,7 +370,7 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, | |||
370 | goto discard; | 370 | goto discard; |
371 | 371 | ||
372 | if (dccp_parse_options(sk, NULL, skb)) | 372 | if (dccp_parse_options(sk, NULL, skb)) |
373 | goto discard; | 373 | return 1; |
374 | 374 | ||
375 | if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 375 | if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) |
376 | dccp_event_ack_recv(sk, skb); | 376 | dccp_event_ack_recv(sk, skb); |
@@ -610,7 +610,7 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
610 | * Step 8: Process options and mark acknowledgeable | 610 | * Step 8: Process options and mark acknowledgeable |
611 | */ | 611 | */ |
612 | if (dccp_parse_options(sk, NULL, skb)) | 612 | if (dccp_parse_options(sk, NULL, skb)) |
613 | goto discard; | 613 | return 1; |
614 | 614 | ||
615 | if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 615 | if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) |
616 | dccp_event_ack_recv(sk, skb); | 616 | dccp_event_ack_recv(sk, skb); |
diff --git a/net/dccp/options.c b/net/dccp/options.c index dc7c158a2f4b..0809b63cb055 100644 --- a/net/dccp/options.c +++ b/net/dccp/options.c | |||
@@ -81,11 +81,11 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq, | |||
81 | /* Check if this isn't a single byte option */ | 81 | /* Check if this isn't a single byte option */ |
82 | if (opt > DCCPO_MAX_RESERVED) { | 82 | if (opt > DCCPO_MAX_RESERVED) { |
83 | if (opt_ptr == opt_end) | 83 | if (opt_ptr == opt_end) |
84 | goto out_invalid_option; | 84 | goto out_nonsensical_length; |
85 | 85 | ||
86 | len = *opt_ptr++; | 86 | len = *opt_ptr++; |
87 | if (len < 3) | 87 | if (len < 2) |
88 | goto out_invalid_option; | 88 | goto out_nonsensical_length; |
89 | /* | 89 | /* |
90 | * Remove the type and len fields, leaving | 90 | * Remove the type and len fields, leaving |
91 | * just the value size | 91 | * just the value size |
@@ -95,7 +95,7 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq, | |||
95 | opt_ptr += len; | 95 | opt_ptr += len; |
96 | 96 | ||
97 | if (opt_ptr > opt_end) | 97 | if (opt_ptr > opt_end) |
98 | goto out_invalid_option; | 98 | goto out_nonsensical_length; |
99 | } | 99 | } |
100 | 100 | ||
101 | /* | 101 | /* |
@@ -283,12 +283,17 @@ ignore_option: | |||
283 | if (mandatory) | 283 | if (mandatory) |
284 | goto out_invalid_option; | 284 | goto out_invalid_option; |
285 | 285 | ||
286 | out_nonsensical_length: | ||
287 | /* RFC 4340, 5.8: ignore option and all remaining option space */ | ||
286 | return 0; | 288 | return 0; |
287 | 289 | ||
288 | out_invalid_option: | 290 | out_invalid_option: |
289 | DCCP_INC_STATS_BH(DCCP_MIB_INVALIDOPT); | 291 | DCCP_INC_STATS_BH(DCCP_MIB_INVALIDOPT); |
290 | DCCP_SKB_CB(skb)->dccpd_reset_code = DCCP_RESET_CODE_OPTION_ERROR; | 292 | DCCP_SKB_CB(skb)->dccpd_reset_code = DCCP_RESET_CODE_OPTION_ERROR; |
291 | DCCP_WARN("DCCP(%p): invalid option %d, len=%d", sk, opt, len); | 293 | DCCP_WARN("DCCP(%p): invalid option %d, len=%d", sk, opt, len); |
294 | DCCP_SKB_CB(skb)->dccpd_reset_data[0] = opt; | ||
295 | DCCP_SKB_CB(skb)->dccpd_reset_data[1] = len > 0 ? value[0] : 0; | ||
296 | DCCP_SKB_CB(skb)->dccpd_reset_data[2] = len > 1 ? value[1] : 0; | ||
292 | return -1; | 297 | return -1; |
293 | } | 298 | } |
294 | 299 | ||
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 1ca3b26eed0f..d0bd34819761 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -309,7 +309,9 @@ int dccp_disconnect(struct sock *sk, int flags) | |||
309 | sk->sk_err = ECONNRESET; | 309 | sk->sk_err = ECONNRESET; |
310 | 310 | ||
311 | dccp_clear_xmit_timers(sk); | 311 | dccp_clear_xmit_timers(sk); |
312 | |||
312 | __skb_queue_purge(&sk->sk_receive_queue); | 313 | __skb_queue_purge(&sk->sk_receive_queue); |
314 | __skb_queue_purge(&sk->sk_write_queue); | ||
313 | if (sk->sk_send_head != NULL) { | 315 | if (sk->sk_send_head != NULL) { |
314 | __kfree_skb(sk->sk_send_head); | 316 | __kfree_skb(sk->sk_send_head); |
315 | sk->sk_send_head = NULL; | 317 | sk->sk_send_head = NULL; |
@@ -1028,7 +1030,7 @@ MODULE_PARM_DESC(thash_entries, "Number of ehash buckets"); | |||
1028 | 1030 | ||
1029 | #ifdef CONFIG_IP_DCCP_DEBUG | 1031 | #ifdef CONFIG_IP_DCCP_DEBUG |
1030 | int dccp_debug; | 1032 | int dccp_debug; |
1031 | module_param(dccp_debug, bool, 0444); | 1033 | module_param(dccp_debug, bool, 0644); |
1032 | MODULE_PARM_DESC(dccp_debug, "Enable debug messages"); | 1034 | MODULE_PARM_DESC(dccp_debug, "Enable debug messages"); |
1033 | 1035 | ||
1034 | EXPORT_SYMBOL_GPL(dccp_debug); | 1036 | EXPORT_SYMBOL_GPL(dccp_debug); |