diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-09-04 01:30:19 -0400 |
---|---|---|
committer | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-09-04 01:45:29 -0400 |
commit | d2150b7bff3d397692cf0dc890f198d23564de5f (patch) | |
tree | 6916928ec289c46bca21c8a99640048e308fef3e /net/dccp/options.c | |
parent | 5a146b97d5e93db2df075c0d820f492bb996d0e3 (diff) |
dccp: Processing Confirm options
Analogous to the previous patch, this adds code to interpret incoming Confirm
feature-negotiation options. Both functions operate on the feature-negotiation
list of either the request_sock (server) or the dccp_sock (client).
Thanks to Wei Yongjun for pointing out that it is overly restrictive to check
the entire list of confirmed SP values.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Diffstat (limited to 'net/dccp/options.c')
-rw-r--r-- | net/dccp/options.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/net/dccp/options.c b/net/dccp/options.c index fb8466ea467a..3a9a22f0ac1a 100644 --- a/net/dccp/options.c +++ b/net/dccp/options.c | |||
@@ -134,26 +134,14 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq, | |||
134 | dccp_pr_debug("%s opt: NDP count=%llu\n", dccp_role(sk), | 134 | dccp_pr_debug("%s opt: NDP count=%llu\n", dccp_role(sk), |
135 | (unsigned long long)opt_recv->dccpor_ndp); | 135 | (unsigned long long)opt_recv->dccpor_ndp); |
136 | break; | 136 | break; |
137 | case DCCPO_CHANGE_L: | 137 | case DCCPO_CHANGE_L ... DCCPO_CONFIRM_R: |
138 | case DCCPO_CHANGE_R: | 138 | if (pkt_type == DCCP_PKT_DATA) /* RFC 4340, 6 */ |
139 | if (pkt_type == DCCP_PKT_DATA) | ||
140 | break; | 139 | break; |
141 | rc = dccp_feat_parse_options(sk, dreq, mandatory, opt, | 140 | rc = dccp_feat_parse_options(sk, dreq, mandatory, opt, |
142 | *value, value + 1, len - 1); | 141 | *value, value + 1, len - 1); |
143 | if (rc) | 142 | if (rc) |
144 | goto out_featneg_failed; | 143 | goto out_featneg_failed; |
145 | break; | 144 | break; |
146 | case DCCPO_CONFIRM_L: | ||
147 | /* fall through */ | ||
148 | case DCCPO_CONFIRM_R: | ||
149 | if (pkt_type == DCCP_PKT_DATA) | ||
150 | break; | ||
151 | if (len < 2) /* FIXME this disallows empty confirm */ | ||
152 | goto out_invalid_option; | ||
153 | if (dccp_feat_confirm_recv(sk, opt, *value, | ||
154 | value + 1, len - 1)) | ||
155 | goto out_invalid_option; | ||
156 | break; | ||
157 | case DCCPO_ACK_VECTOR_0: | 145 | case DCCPO_ACK_VECTOR_0: |
158 | case DCCPO_ACK_VECTOR_1: | 146 | case DCCPO_ACK_VECTOR_1: |
159 | if (dccp_packet_without_ack(skb)) /* RFC 4340, 11.4 */ | 147 | if (dccp_packet_without_ack(skb)) /* RFC 4340, 11.4 */ |