diff options
author | Samuel Jero <sj323707@ohio.edu> | 2011-07-24 23:06:37 -0400 |
---|---|---|
committer | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2011-08-01 09:52:35 -0400 |
commit | a6444f4237af6c9981ddd45ab35a5c06d4e5a4d8 (patch) | |
tree | a9d6ceb601854d6a7cd23543ba4ef0fc7ab4c8a6 /net | |
parent | 44e6fd9e67c1043aaeed381c10b74e73807b7f26 (diff) |
dccp: send Confirm options only once
If a connection is in the OPEN state, remove feature negotiation Confirm
options from the list of options after sending them once; as such options
are NOT supposed to be retransmitted and are ONLY supposed to be sent in
response to a Change option (RFC 4340 6.2).
Signed-off-by: Samuel Jero <sj323707@ohio.edu>
Acked-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'net')
-rw-r--r-- | net/dccp/feat.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/net/dccp/feat.c b/net/dccp/feat.c index ad6f9e2cac1a..23cea0ee3101 100644 --- a/net/dccp/feat.c +++ b/net/dccp/feat.c | |||
@@ -665,11 +665,22 @@ int dccp_feat_insert_opts(struct dccp_sock *dp, struct dccp_request_sock *dreq, | |||
665 | return -1; | 665 | return -1; |
666 | if (pos->needs_mandatory && dccp_insert_option_mandatory(skb)) | 666 | if (pos->needs_mandatory && dccp_insert_option_mandatory(skb)) |
667 | return -1; | 667 | return -1; |
668 | /* | 668 | |
669 | * Enter CHANGING after transmitting the Change option (6.6.2). | 669 | if (skb->sk->sk_state == DCCP_OPEN && |
670 | */ | 670 | (opt == DCCPO_CONFIRM_R || opt == DCCPO_CONFIRM_L)) { |
671 | if (pos->state == FEAT_INITIALISING) | 671 | /* |
672 | pos->state = FEAT_CHANGING; | 672 | * Confirms don't get retransmitted (6.6.3) once the |
673 | * connection is in state OPEN | ||
674 | */ | ||
675 | dccp_feat_list_pop(pos); | ||
676 | } else { | ||
677 | /* | ||
678 | * Enter CHANGING after transmitting the Change | ||
679 | * option (6.6.2). | ||
680 | */ | ||
681 | if (pos->state == FEAT_INITIALISING) | ||
682 | pos->state = FEAT_CHANGING; | ||
683 | } | ||
673 | } | 684 | } |
674 | return 0; | 685 | return 0; |
675 | } | 686 | } |