]> err.no Git - linux-2.6/commitdiff
[CCID] Only call the HC insert_options methods when requested
authorArnaldo Carvalho de Melo <acme@mandriva.com>
Fri, 9 Sep 2005 05:30:07 +0000 (02:30 -0300)
committerArnaldo Carvalho de Melo <acme@mandriva.com>
Fri, 9 Sep 2005 05:30:07 +0000 (02:30 -0300)
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
include/linux/dccp.h
net/dccp/ccids/ccid3.c
net/dccp/options.c

index 007c290f74d4557b38161fe1ef9378fc4919f0bb..5e0af0d08a93c208439bfaf49a9bc8be7145e4a9 100644 (file)
@@ -433,6 +433,8 @@ struct dccp_sock {
        struct ccid                     *dccps_hc_tx_ccid;
        struct dccp_options_received    dccps_options_received;
        enum dccp_role                  dccps_role:2;
+       __u8                            dccps_hc_rx_insert_options:1;
+       __u8                            dccps_hc_tx_insert_options:1;
 };
  
 static inline struct dccp_sock *dccp_sk(const struct sock *sk)
index ae0500c79d07d677d51ec875f1f051601258226e..37fd9eb8daaf894fe7d258df7a418f2dab002c29 100644 (file)
@@ -358,10 +358,12 @@ static int ccid3_hc_tx_send_packet(struct sock *sk,
        }
 
        /* Can we send? if so add options and add to packet history */
-       if (rc == 0)
+       if (rc == 0) {
+               dp->dccps_hc_tx_insert_options = 1;
                new_packet->dccphtx_ccval =
                        DCCP_SKB_CB(skb)->dccpd_ccval =
                                hctx->ccid3hctx_last_win_count;
+       }
 out:
        return rc;
 }
@@ -811,6 +813,7 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk)
                hcrx->ccid3hcrx_pinv = ~0;
        else
                hcrx->ccid3hcrx_pinv = 1000000 / hcrx->ccid3hcrx_p;
+       dp->dccps_hc_rx_insert_options = 1;
        dccp_send_ack(sk);
 }
 
index 382c5894acb20590ba4943181130ffdae9dd0f19..7ad2f4266ff9f774cca64824c586f362c186d6f3 100644 (file)
@@ -505,13 +505,18 @@ void dccp_insert_options(struct sock *sk, struct sk_buff *skb)
                    (dp->dccps_hc_rx_ackpkts->dccpap_buf_ackno !=
                     DCCP_MAX_SEQNO + 1))
                        dccp_insert_option_ack_vector(sk, skb);
-
                if (dp->dccps_timestamp_echo != 0)
                        dccp_insert_option_timestamp_echo(sk, skb);
        }
 
-       ccid_hc_rx_insert_options(dp->dccps_hc_rx_ccid, sk, skb);
-       ccid_hc_tx_insert_options(dp->dccps_hc_tx_ccid, sk, skb);
+       if (dp->dccps_hc_rx_insert_options) {
+               ccid_hc_rx_insert_options(dp->dccps_hc_rx_ccid, sk, skb);
+               dp->dccps_hc_rx_insert_options = 0;
+       }
+       if (dp->dccps_hc_tx_insert_options) {
+               ccid_hc_tx_insert_options(dp->dccps_hc_tx_ccid, sk, skb);
+               dp->dccps_hc_tx_insert_options = 0;
+       }
 
        /* XXX: insert other options when appropriate */