diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-11-12 03:42:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-12 03:42:58 -0500 |
commit | f74e91b6cca5889e667193c7e794186db73c2000 (patch) | |
tree | 10f6a612d97b3ab5ba4ecd75b6decb669f178d76 /net/dccp/feat.c | |
parent | 6bb3ce25d05f2990c8a19adaf427531430267c1f (diff) |
dccp: Limit feature negotiation to connection setup phase
This patch limits feature (capability) negotation to the connection setup phase:
1. Although it is theoretically possible to perform feature negotiation at any
time (and RFC 4340 supports this), in practice this is prohibitively complex,
as it requires to put traffic on hold for each new negotiation.
2. As a byproduct of restricting feature negotiation to connection setup, the
feature-negotiation retransmit timer is no longer required. This part is now
mapped onto the protocol-level retransmission.
Details indicating why timers are no longer needed can be found on
http://www.erg.abdn.ac.uk/users/gerrit/dccp/notes/feature_negotiation/\
implementation_notes.html
This patch disables anytime negotiation, subsequent patches work out full
feature negotiation support for connection setup.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/feat.c')
-rw-r--r-- | net/dccp/feat.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/net/dccp/feat.c b/net/dccp/feat.c index 069d8ffe4c6f..0e789e2e0aa9 100644 --- a/net/dccp/feat.c +++ b/net/dccp/feat.c | |||
@@ -6,6 +6,8 @@ | |||
6 | * | 6 | * |
7 | * ASSUMPTIONS | 7 | * ASSUMPTIONS |
8 | * ----------- | 8 | * ----------- |
9 | * o Feature negotiation is coordinated with connection setup (as in TCP), wild | ||
10 | * changes of parameters of an established connection are not supported. | ||
9 | * o All currently known SP features have 1-byte quantities. If in the future | 11 | * o All currently known SP features have 1-byte quantities. If in the future |
10 | * extensions of RFCs 4340..42 define features with item lengths larger than | 12 | * extensions of RFCs 4340..42 define features with item lengths larger than |
11 | * one byte, a feature-specific extension of the code will be required. | 13 | * one byte, a feature-specific extension of the code will be required. |
@@ -542,6 +544,9 @@ int dccp_feat_change_recv(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len) | |||
542 | { | 544 | { |
543 | int rc; | 545 | int rc; |
544 | 546 | ||
547 | /* Ignore Change requests other than during connection setup */ | ||
548 | if (sk->sk_state != DCCP_LISTEN && sk->sk_state != DCCP_REQUESTING) | ||
549 | return 0; | ||
545 | dccp_feat_debug(type, feature, *val); | 550 | dccp_feat_debug(type, feature, *val); |
546 | 551 | ||
547 | /* figure out if it's SP or NN feature */ | 552 | /* figure out if it's SP or NN feature */ |
@@ -591,6 +596,9 @@ int dccp_feat_confirm_recv(struct sock *sk, u8 type, u8 feature, | |||
591 | int found = 0; | 596 | int found = 0; |
592 | int all_confirmed = 1; | 597 | int all_confirmed = 1; |
593 | 598 | ||
599 | /* Ignore Confirm options other than during connection setup */ | ||
600 | if (sk->sk_state != DCCP_LISTEN && sk->sk_state != DCCP_REQUESTING) | ||
601 | return 0; | ||
594 | dccp_feat_debug(type, feature, *val); | 602 | dccp_feat_debug(type, feature, *val); |
595 | 603 | ||
596 | /* locate our change request */ | 604 | /* locate our change request */ |
@@ -625,17 +633,6 @@ int dccp_feat_confirm_recv(struct sock *sk, u8 type, u8 feature, | |||
625 | all_confirmed = 0; | 633 | all_confirmed = 0; |
626 | } | 634 | } |
627 | 635 | ||
628 | /* fix re-transmit timer */ | ||
629 | /* XXX gotta make sure that no option negotiation occurs during | ||
630 | * connection shutdown. Consider that the CLOSEREQ is sent and timer is | ||
631 | * on. if all options are confirmed it might kill timer which should | ||
632 | * remain alive until close is received. | ||
633 | */ | ||
634 | if (all_confirmed) { | ||
635 | dccp_pr_debug("clear feat negotiation timer %p\n", sk); | ||
636 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_RETRANS); | ||
637 | } | ||
638 | |||
639 | if (!found) | 636 | if (!found) |
640 | dccp_pr_debug("%s(%d, ...) never requested\n", | 637 | dccp_pr_debug("%s(%d, ...) never requested\n", |
641 | dccp_feat_typename(type), feature); | 638 | dccp_feat_typename(type), feature); |