diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-09-04 01:30:19 -0400 |
---|---|---|
committer | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-09-04 01:45:31 -0400 |
commit | b235dc4abbc1356284bd0dc730efa711f394e0e2 (patch) | |
tree | c8adf34d1904c04ab0bee54e3d60f743822a8e9f /net/dccp/options.c | |
parent | 68e074bfcef269bc61006c2740d7f89ccbbd93d7 (diff) |
dccp ccid-2: Phase out the use of boolean Ack Vector sysctl
This removes the use of the sysctl and the minisock variable for the Send Ack
Vector feature, which is now handled fully dynamically via feature negotiation;
i.e. when CCID2 is enabled, Ack Vectors are automatically enabled (as per
RFC 4341, 4.).
Using a sysctl in parallel to this implementation would open the door to
crashes, since much of the code relies on tests of the boolean minisock /
sysctl variable. Thus, this patch replaces all tests of type
if (dccp_msk(sk)->dccpms_send_ack_vector)
/* ... */
with
if (dp->dccps_hc_rx_ackvec != NULL)
/* ... */
The dccps_hc_rx_ackvec is allocated by the dccp_hdlr_ackvec() when feature
negotiation concluded that Ack Vectors are to be used on the half-connection.
Otherwise, it is NULL (due to dccp_init_sock/dccp_create_openreq_child),
so that the test is a valid one.
The activation handler for Ack Vectors is called as soon as the feature
negotiation has concluded at the
* server when the Ack marking the transition RESPOND => OPEN arrives;
* client after it has sent its ACK, marking the transition REQUEST => PARTOPEN.
Adding the sequence number of the Response packet to the Ack Vector has been
removed, since
(a) connection establishment implies that the Response has been received;
(b) the CCIDs only look at packets received in the (PART)OPEN state, i.e.
this entry will always be ignored;
(c) it can not be used for anything useful - to detect loss for instance, only
packets received after the loss can serve as pseudo-dupacks.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Diffstat (limited to 'net/dccp/options.c')
-rw-r--r-- | net/dccp/options.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/dccp/options.c b/net/dccp/options.c index 6b0704497e83..aca309e16632 100644 --- a/net/dccp/options.c +++ b/net/dccp/options.c | |||
@@ -26,7 +26,6 @@ | |||
26 | int sysctl_dccp_feat_sequence_window = DCCPF_INITIAL_SEQUENCE_WINDOW; | 26 | int sysctl_dccp_feat_sequence_window = DCCPF_INITIAL_SEQUENCE_WINDOW; |
27 | int sysctl_dccp_feat_rx_ccid = DCCPF_INITIAL_CCID; | 27 | int sysctl_dccp_feat_rx_ccid = DCCPF_INITIAL_CCID; |
28 | int sysctl_dccp_feat_tx_ccid = DCCPF_INITIAL_CCID; | 28 | int sysctl_dccp_feat_tx_ccid = DCCPF_INITIAL_CCID; |
29 | int sysctl_dccp_feat_send_ack_vector = DCCPF_INITIAL_SEND_ACK_VECTOR; | ||
30 | 29 | ||
31 | u64 dccp_decode_value_var(const u8 *bf, const u8 len) | 30 | u64 dccp_decode_value_var(const u8 *bf, const u8 len) |
32 | { | 31 | { |
@@ -145,8 +144,7 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq, | |||
145 | case DCCPO_ACK_VECTOR_1: | 144 | case DCCPO_ACK_VECTOR_1: |
146 | if (dccp_packet_without_ack(skb)) /* RFC 4340, 11.4 */ | 145 | if (dccp_packet_without_ack(skb)) /* RFC 4340, 11.4 */ |
147 | break; | 146 | break; |
148 | 147 | if (dp->dccps_hc_rx_ackvec != NULL && | |
149 | if (dccp_msk(sk)->dccpms_send_ack_vector && | ||
150 | dccp_ackvec_parse(sk, skb, &ackno, opt, value, len)) | 148 | dccp_ackvec_parse(sk, skb, &ackno, opt, value, len)) |
151 | goto out_invalid_option; | 149 | goto out_invalid_option; |
152 | break; | 150 | break; |
@@ -526,7 +524,6 @@ static void dccp_insert_option_padding(struct sk_buff *skb) | |||
526 | int dccp_insert_options(struct sock *sk, struct sk_buff *skb) | 524 | int dccp_insert_options(struct sock *sk, struct sk_buff *skb) |
527 | { | 525 | { |
528 | struct dccp_sock *dp = dccp_sk(sk); | 526 | struct dccp_sock *dp = dccp_sk(sk); |
529 | struct dccp_minisock *dmsk = dccp_msk(sk); | ||
530 | 527 | ||
531 | DCCP_SKB_CB(skb)->dccpd_opt_len = 0; | 528 | DCCP_SKB_CB(skb)->dccpd_opt_len = 0; |
532 | 529 | ||
@@ -547,7 +544,7 @@ int dccp_insert_options(struct sock *sk, struct sk_buff *skb) | |||
547 | if (dccp_insert_option_timestamp(sk, skb)) | 544 | if (dccp_insert_option_timestamp(sk, skb)) |
548 | return -1; | 545 | return -1; |
549 | 546 | ||
550 | } else if (dmsk->dccpms_send_ack_vector && | 547 | } else if (dp->dccps_hc_rx_ackvec != NULL && |
551 | dccp_ackvec_pending(dp->dccps_hc_rx_ackvec) && | 548 | dccp_ackvec_pending(dp->dccps_hc_rx_ackvec) && |
552 | dccp_insert_option_ackvec(sk, skb)) { | 549 | dccp_insert_option_ackvec(sk, skb)) { |
553 | return -1; | 550 | return -1; |