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/input.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/input.c')
-rw-r--r-- | net/dccp/input.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/net/dccp/input.c b/net/dccp/input.c index 0672b7e1763e..5eb443f656c1 100644 --- a/net/dccp/input.c +++ b/net/dccp/input.c | |||
@@ -163,7 +163,7 @@ static void dccp_event_ack_recv(struct sock *sk, struct sk_buff *skb) | |||
163 | { | 163 | { |
164 | struct dccp_sock *dp = dccp_sk(sk); | 164 | struct dccp_sock *dp = dccp_sk(sk); |
165 | 165 | ||
166 | if (dccp_msk(sk)->dccpms_send_ack_vector) | 166 | if (dp->dccps_hc_rx_ackvec != NULL) |
167 | dccp_ackvec_check_rcv_ackno(dp->dccps_hc_rx_ackvec, sk, | 167 | dccp_ackvec_check_rcv_ackno(dp->dccps_hc_rx_ackvec, sk, |
168 | DCCP_SKB_CB(skb)->dccpd_ack_seq); | 168 | DCCP_SKB_CB(skb)->dccpd_ack_seq); |
169 | } | 169 | } |
@@ -375,7 +375,7 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, | |||
375 | if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 375 | if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) |
376 | dccp_event_ack_recv(sk, skb); | 376 | dccp_event_ack_recv(sk, skb); |
377 | 377 | ||
378 | if (dccp_msk(sk)->dccpms_send_ack_vector && | 378 | if (dp->dccps_hc_rx_ackvec != NULL && |
379 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, | 379 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, |
380 | DCCP_SKB_CB(skb)->dccpd_seq, | 380 | DCCP_SKB_CB(skb)->dccpd_seq, |
381 | DCCP_ACKVEC_STATE_RECEIVED)) | 381 | DCCP_ACKVEC_STATE_RECEIVED)) |
@@ -434,12 +434,6 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk, | |||
434 | dp->dccps_syn_rtt = dccp_sample_rtt(sk, 10 * (tstamp - | 434 | dp->dccps_syn_rtt = dccp_sample_rtt(sk, 10 * (tstamp - |
435 | dp->dccps_options_received.dccpor_timestamp_echo)); | 435 | dp->dccps_options_received.dccpor_timestamp_echo)); |
436 | 436 | ||
437 | if (dccp_msk(sk)->dccpms_send_ack_vector && | ||
438 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, | ||
439 | DCCP_SKB_CB(skb)->dccpd_seq, | ||
440 | DCCP_ACKVEC_STATE_RECEIVED)) | ||
441 | goto out_invalid_packet; /* FIXME: change error code */ | ||
442 | |||
443 | /* Stop the REQUEST timer */ | 437 | /* Stop the REQUEST timer */ |
444 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_RETRANS); | 438 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_RETRANS); |
445 | WARN_ON(sk->sk_send_head == NULL); | 439 | WARN_ON(sk->sk_send_head == NULL); |
@@ -637,7 +631,7 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
637 | if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 631 | if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) |
638 | dccp_event_ack_recv(sk, skb); | 632 | dccp_event_ack_recv(sk, skb); |
639 | 633 | ||
640 | if (dccp_msk(sk)->dccpms_send_ack_vector && | 634 | if (dp->dccps_hc_rx_ackvec != NULL && |
641 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, | 635 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, |
642 | DCCP_SKB_CB(skb)->dccpd_seq, | 636 | DCCP_SKB_CB(skb)->dccpd_seq, |
643 | DCCP_ACKVEC_STATE_RECEIVED)) | 637 | DCCP_ACKVEC_STATE_RECEIVED)) |