diff options
Diffstat (limited to 'net/dccp/feat.c')
-rw-r--r-- | net/dccp/feat.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/net/dccp/feat.c b/net/dccp/feat.c index 5ebdd86c1b99..084744e624d3 100644 --- a/net/dccp/feat.c +++ b/net/dccp/feat.c | |||
@@ -24,11 +24,7 @@ int dccp_feat_change(struct dccp_minisock *dmsk, u8 type, u8 feature, | |||
24 | 24 | ||
25 | dccp_feat_debug(type, feature, *val); | 25 | dccp_feat_debug(type, feature, *val); |
26 | 26 | ||
27 | if (!dccp_feat_is_valid_type(type)) { | 27 | if (len > 3) { |
28 | DCCP_WARN("option type %d invalid in negotiation\n", type); | ||
29 | return 1; | ||
30 | } | ||
31 | if (!dccp_feat_is_valid_length(type, feature, len)) { | ||
32 | DCCP_WARN("invalid length %d\n", len); | 28 | DCCP_WARN("invalid length %d\n", len); |
33 | return 1; | 29 | return 1; |
34 | } | 30 | } |
@@ -637,12 +633,12 @@ const char *dccp_feat_name(const u8 feat) | |||
637 | [DCCPF_MIN_CSUM_COVER] = "Min. Csum Coverage", | 633 | [DCCPF_MIN_CSUM_COVER] = "Min. Csum Coverage", |
638 | [DCCPF_DATA_CHECKSUM] = "Send Data Checksum", | 634 | [DCCPF_DATA_CHECKSUM] = "Send Data Checksum", |
639 | }; | 635 | }; |
636 | if (feat > DCCPF_DATA_CHECKSUM && feat < DCCPF_MIN_CCID_SPECIFIC) | ||
637 | return feature_names[DCCPF_RESERVED]; | ||
638 | |||
640 | if (feat >= DCCPF_MIN_CCID_SPECIFIC) | 639 | if (feat >= DCCPF_MIN_CCID_SPECIFIC) |
641 | return "CCID-specific"; | 640 | return "CCID-specific"; |
642 | 641 | ||
643 | if (dccp_feat_is_reserved(feat)) | ||
644 | return feature_names[DCCPF_RESERVED]; | ||
645 | |||
646 | return feature_names[feat]; | 642 | return feature_names[feat]; |
647 | } | 643 | } |
648 | 644 | ||