]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/dccp/feat.c
dccp: send Confirm options only once
[karo-tx-linux.git] / net / dccp / feat.c
index ad6f9e2cac1a23946f0e72e9a4405851d76bd39c..23cea0ee31015d4988ce0456be919f1a24326b79 100644 (file)
@@ -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;
 }