diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-09-09 01:30:07 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-09-09 01:30:07 -0400 |
commit | 507d37cf269ebbd1b32bcc435fe577e411f73151 (patch) | |
tree | 68b797a2f2c8645a86ac1a5f521df6b8873d9338 | |
parent | 0ba7a3ba6608de6e0c0bfe3009a63d7e0b7ab0ce (diff) |
[CCID] Only call the HC insert_options methods when requested
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
-rw-r--r-- | include/linux/dccp.h | 2 | ||||
-rw-r--r-- | net/dccp/ccids/ccid3.c | 5 | ||||
-rw-r--r-- | net/dccp/options.c | 11 |
3 files changed, 14 insertions, 4 deletions
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 007c290f74d4..5e0af0d08a93 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -433,6 +433,8 @@ struct dccp_sock { | |||
433 | struct ccid *dccps_hc_tx_ccid; | 433 | struct ccid *dccps_hc_tx_ccid; |
434 | struct dccp_options_received dccps_options_received; | 434 | struct dccp_options_received dccps_options_received; |
435 | enum dccp_role dccps_role:2; | 435 | enum dccp_role dccps_role:2; |
436 | __u8 dccps_hc_rx_insert_options:1; | ||
437 | __u8 dccps_hc_tx_insert_options:1; | ||
436 | }; | 438 | }; |
437 | 439 | ||
438 | static inline struct dccp_sock *dccp_sk(const struct sock *sk) | 440 | static inline struct dccp_sock *dccp_sk(const struct sock *sk) |
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index ae0500c79d07..37fd9eb8daaf 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -358,10 +358,12 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, | |||
358 | } | 358 | } |
359 | 359 | ||
360 | /* Can we send? if so add options and add to packet history */ | 360 | /* Can we send? if so add options and add to packet history */ |
361 | if (rc == 0) | 361 | if (rc == 0) { |
362 | dp->dccps_hc_tx_insert_options = 1; | ||
362 | new_packet->dccphtx_ccval = | 363 | new_packet->dccphtx_ccval = |
363 | DCCP_SKB_CB(skb)->dccpd_ccval = | 364 | DCCP_SKB_CB(skb)->dccpd_ccval = |
364 | hctx->ccid3hctx_last_win_count; | 365 | hctx->ccid3hctx_last_win_count; |
366 | } | ||
365 | out: | 367 | out: |
366 | return rc; | 368 | return rc; |
367 | } | 369 | } |
@@ -811,6 +813,7 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk) | |||
811 | hcrx->ccid3hcrx_pinv = ~0; | 813 | hcrx->ccid3hcrx_pinv = ~0; |
812 | else | 814 | else |
813 | hcrx->ccid3hcrx_pinv = 1000000 / hcrx->ccid3hcrx_p; | 815 | hcrx->ccid3hcrx_pinv = 1000000 / hcrx->ccid3hcrx_p; |
816 | dp->dccps_hc_rx_insert_options = 1; | ||
814 | dccp_send_ack(sk); | 817 | dccp_send_ack(sk); |
815 | } | 818 | } |
816 | 819 | ||
diff --git a/net/dccp/options.c b/net/dccp/options.c index 382c5894acb2..7ad2f4266ff9 100644 --- a/net/dccp/options.c +++ b/net/dccp/options.c | |||
@@ -505,13 +505,18 @@ void dccp_insert_options(struct sock *sk, struct sk_buff *skb) | |||
505 | (dp->dccps_hc_rx_ackpkts->dccpap_buf_ackno != | 505 | (dp->dccps_hc_rx_ackpkts->dccpap_buf_ackno != |
506 | DCCP_MAX_SEQNO + 1)) | 506 | DCCP_MAX_SEQNO + 1)) |
507 | dccp_insert_option_ack_vector(sk, skb); | 507 | dccp_insert_option_ack_vector(sk, skb); |
508 | |||
509 | if (dp->dccps_timestamp_echo != 0) | 508 | if (dp->dccps_timestamp_echo != 0) |
510 | dccp_insert_option_timestamp_echo(sk, skb); | 509 | dccp_insert_option_timestamp_echo(sk, skb); |
511 | } | 510 | } |
512 | 511 | ||
513 | ccid_hc_rx_insert_options(dp->dccps_hc_rx_ccid, sk, skb); | 512 | if (dp->dccps_hc_rx_insert_options) { |
514 | ccid_hc_tx_insert_options(dp->dccps_hc_tx_ccid, sk, skb); | 513 | ccid_hc_rx_insert_options(dp->dccps_hc_rx_ccid, sk, skb); |
514 | dp->dccps_hc_rx_insert_options = 0; | ||
515 | } | ||
516 | if (dp->dccps_hc_tx_insert_options) { | ||
517 | ccid_hc_tx_insert_options(dp->dccps_hc_tx_ccid, sk, skb); | ||
518 | dp->dccps_hc_tx_insert_options = 0; | ||
519 | } | ||
515 | 520 | ||
516 | /* XXX: insert other options when appropriate */ | 521 | /* XXX: insert other options when appropriate */ |
517 | 522 | ||