aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/output.c
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2008-11-17 01:49:52 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-17 01:49:52 -0500
commit0c1168398ecbfacbb27203b281bde20ec9f78017 (patch)
tree3298379e950bba174b46e53102f265829340fa6d /net/dccp/output.c
parent3f2c31d90327f21d76d296af34aa4ca547932ff4 (diff)
dccp: Mechanism to resolve CCID dependencies
This adds a hook to resolve features whose value depends on the choice of CCID. It is done at the server since it can only be done after the CCID values have been negotiated; i.e. the client will add its CCID preference list on the Change options sent in the Request, which will be reconciled with the local preference list of the server. The concept is documented on http://www.erg.abdn.ac.uk/users/gerrit/dccp/notes/feature_negotiation/\ implementation_notes.html#ccid_dependencies 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/output.c')
-rw-r--r--net/dccp/output.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c
index 92f3f6f2ef51..fea30cdc0bee 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -339,10 +339,12 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst,
339 DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_RESPONSE; 339 DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_RESPONSE;
340 DCCP_SKB_CB(skb)->dccpd_seq = dreq->dreq_iss; 340 DCCP_SKB_CB(skb)->dccpd_seq = dreq->dreq_iss;
341 341
342 if (dccp_insert_options_rsk(dreq, skb)) { 342 /* Resolve feature dependencies resulting from choice of CCID */
343 kfree_skb(skb); 343 if (dccp_feat_server_ccid_dependencies(dreq))
344 return NULL; 344 goto response_failed;
345 } 345
346 if (dccp_insert_options_rsk(dreq, skb))
347 goto response_failed;
346 348
347 /* Build and checksum header */ 349 /* Build and checksum header */
348 dh = dccp_zeroed_hdr(skb, dccp_header_size); 350 dh = dccp_zeroed_hdr(skb, dccp_header_size);
@@ -363,6 +365,9 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst,
363 inet_rsk(req)->acked = 1; 365 inet_rsk(req)->acked = 1;
364 DCCP_INC_STATS(DCCP_MIB_OUTSEGS); 366 DCCP_INC_STATS(DCCP_MIB_OUTSEGS);
365 return skb; 367 return skb;
368response_failed:
369 kfree_skb(skb);
370 return NULL;
366} 371}
367 372
368EXPORT_SYMBOL_GPL(dccp_make_response); 373EXPORT_SYMBOL_GPL(dccp_make_response);