aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/dccp/options.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/dccp/options.c b/net/dccp/options.c
index d286cffe2c49..523250b45ea5 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -136,7 +136,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
136 break; 136 break;
137 case DCCPO_ACK_VECTOR_0: 137 case DCCPO_ACK_VECTOR_0:
138 case DCCPO_ACK_VECTOR_1: 138 case DCCPO_ACK_VECTOR_1:
139 if (pkt_type == DCCP_PKT_DATA) 139 if (dccp_packet_without_ack(skb)) /* RFC 4340, 11.4 */
140 break; 140 break;
141 141
142 if (dccp_msk(sk)->dccpms_send_ack_vector && 142 if (dccp_msk(sk)->dccpms_send_ack_vector &&
@@ -194,18 +194,17 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
194 opt_recv->dccpor_elapsed_time = elapsed_time; 194 opt_recv->dccpor_elapsed_time = elapsed_time;
195 break; 195 break;
196 case DCCPO_ELAPSED_TIME: 196 case DCCPO_ELAPSED_TIME:
197 if (len != 2 && len != 4) 197 if (dccp_packet_without_ack(skb)) /* RFC 4340, 13.2 */
198 goto out_invalid_option; 198 break;
199
200 if (pkt_type == DCCP_PKT_DATA)
201 continue;
202 199
203 if (len == 2) { 200 if (len == 2) {
204 __be16 opt_val2 = get_unaligned((__be16 *)value); 201 __be16 opt_val2 = get_unaligned((__be16 *)value);
205 elapsed_time = ntohs(opt_val2); 202 elapsed_time = ntohs(opt_val2);
206 } else { 203 } else if (len == 4) {
207 opt_val = get_unaligned((__be32 *)value); 204 opt_val = get_unaligned((__be32 *)value);
208 elapsed_time = ntohl(opt_val); 205 elapsed_time = ntohl(opt_val);
206 } else {
207 goto out_invalid_option;
209 } 208 }
210 209
211 if (elapsed_time > opt_recv->dccpor_elapsed_time) 210 if (elapsed_time > opt_recv->dccpor_elapsed_time)