diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-12-02 02:33:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-02 02:33:18 -0500 |
commit | b1ad00422ecba0449f8e3a8f2ec9267bc994bf8f (patch) | |
tree | 6a3923ca76d60dd0e39b7323c8abaa74bbc7db20 /net/dccp/options.c | |
parent | e77b8363b2ea7c0d89919547c1a8b0562f298b57 (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>
Signed-off-by: David S. Miller <davem@davemloft.net>
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 2c444c199725..debb1008c7ad 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 */ |