diff options
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 faade82856fe..77ce2f6b0319 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. |
@@ -652,6 +654,9 @@ int dccp_feat_change_recv(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len) | |||
652 | { | 654 | { |
653 | int rc; | 655 | int rc; |
654 | 656 | ||
657 | /* Ignore Change requests other than during connection setup */ | ||
658 | if (sk->sk_state != DCCP_LISTEN && sk->sk_state != DCCP_REQUESTING) | ||
659 | return 0; | ||
655 | dccp_feat_debug(type, feature, *val); | 660 | dccp_feat_debug(type, feature, *val); |
656 | 661 | ||
657 | /* figure out if it's SP or NN feature */ | 662 | /* figure out if it's SP or NN feature */ |
@@ -701,6 +706,9 @@ int dccp_feat_confirm_recv(struct sock *sk, u8 type, u8 feature, | |||
701 | int found = 0; | 706 | int found = 0; |
702 | int all_confirmed = 1; | 707 | int all_confirmed = 1; |
703 | 708 | ||
709 | /* Ignore Confirm options other than during connection setup */ | ||
710 | if (sk->sk_state != DCCP_LISTEN && sk->sk_state != DCCP_REQUESTING) | ||
711 | return 0; | ||
704 | dccp_feat_debug(type, feature, *val); | 712 | dccp_feat_debug(type, feature, *val); |
705 | 713 | ||
706 | /* locate our change request */ | 714 | /* locate our change request */ |
@@ -735,17 +743,6 @@ int dccp_feat_confirm_recv(struct sock *sk, u8 type, u8 feature, | |||
735 | all_confirmed = 0; | 743 | all_confirmed = 0; |
736 | } | 744 | } |
737 | 745 | ||
738 | /* fix re-transmit timer */ | ||
739 | /* XXX gotta make sure that no option negotiation occurs during | ||
740 | * connection shutdown. Consider that the CLOSEREQ is sent and timer is | ||
741 | * on. if all options are confirmed it might kill timer which should | ||
742 | * remain alive until close is received. | ||
743 | */ | ||
744 | if (all_confirmed) { | ||
745 | dccp_pr_debug("clear feat negotiation timer %p\n", sk); | ||
746 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_RETRANS); | ||
747 | } | ||
748 | |||
749 | if (!found) | 746 | if (!found) |
750 | dccp_pr_debug("%s(%d, ...) never requested\n", | 747 | dccp_pr_debug("%s(%d, ...) never requested\n", |
751 | dccp_feat_typename(type), feature); | 748 | dccp_feat_typename(type), feature); |