aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/feat.c
diff options
context:
space:
mode:
authorSamuel Jero <sj323707@ohio.edu>2011-07-24 21:06:37 -0600
committerGerrit Renker <gerrit@erg.abdn.ac.uk>2011-08-01 07:52:35 -0600
commita6444f4237af6c9981ddd45ab35a5c06d4e5a4d8 (patch)
treea9d6ceb601854d6a7cd23543ba4ef0fc7ab4c8a6 /net/dccp/feat.c
parentdccp: support for exchanging of NN options in established state 2/2 (diff)
downloadlinux-dev-a6444f4237af6c9981ddd45ab35a5c06d4e5a4d8.tar.xz
linux-dev-a6444f4237af6c9981ddd45ab35a5c06d4e5a4d8.zip
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 '')
-rw-r--r--net/dccp/feat.c21
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,
return -1;
if (pos->needs_mandatory && dccp_insert_option_mandatory(skb))
return -1;
- /*
- * Enter CHANGING after transmitting the Change option (6.6.2).
- */
- if (pos->state == FEAT_INITIALISING)
- pos->state = FEAT_CHANGING;
+
+ if (skb->sk->sk_state == DCCP_OPEN &&
+ (opt == DCCPO_CONFIRM_R || opt == DCCPO_CONFIRM_L)) {
+ /*
+ * Confirms don't get retransmitted (6.6.3) once the
+ * connection is in state OPEN
+ */
+ dccp_feat_list_pop(pos);
+ } else {
+ /*
+ * Enter CHANGING after transmitting the Change
+ * option (6.6.2).
+ */
+ if (pos->state == FEAT_INITIALISING)
+ pos->state = FEAT_CHANGING;
+ }
}
return 0;
}