aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/dccp/options.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/dccp/options.c b/net/dccp/options.c
index 79d228e4d6b2..8867b6f43220 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -109,7 +109,8 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
109 case DCCPO_MANDATORY: 109 case DCCPO_MANDATORY:
110 if (mandatory) 110 if (mandatory)
111 goto out_invalid_option; 111 goto out_invalid_option;
112 mandatory = 1; 112 if (pkt_type != DCCP_PKT_DATA)
113 mandatory = 1;
113 break; 114 break;
114 case DCCPO_NDP_COUNT: 115 case DCCPO_NDP_COUNT:
115 if (len > 3) 116 if (len > 3)
@@ -249,6 +250,10 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
249 mandatory = 0; 250 mandatory = 0;
250 } 251 }
251 252
253 /* mandatory was the last byte in option list -> reset connection */
254 if (mandatory)
255 goto out_invalid_option;
256
252 return 0; 257 return 0;
253 258
254out_invalid_option: 259out_invalid_option: