aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/options.c
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2008-12-08 04:19:06 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-08 04:19:06 -0500
commit6fdd34d43bff8be9bb925b49d87a0ee144d2ab07 (patch)
tree547cf602983db37d573d3d191ac11660f1698e8f /net/dccp/options.c
parent4098dce5be537a157eed4a326efd464109825b8b (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, as it now is handled fully dynamically via feature negotiation (i.e. when CCID-2 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. There was a FIXME to change the error code when dccp_ackvec_add() fails. I removed this after finding out that: * the check whether ackno < ISN is already made earlier, * this Response is likely the 1st packet with an Ackno that the client gets, * so when dccp_ackvec_add() fails, the reason is likely not a packet error. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/options.c')
-rw-r--r--net/dccp/options.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/dccp/options.c b/net/dccp/options.c
index e9d674874b4e..7b1165c21f51 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -26,7 +26,6 @@
26int sysctl_dccp_feat_sequence_window = DCCPF_INITIAL_SEQUENCE_WINDOW; 26int sysctl_dccp_feat_sequence_window = DCCPF_INITIAL_SEQUENCE_WINDOW;
27int sysctl_dccp_feat_rx_ccid = DCCPF_INITIAL_CCID; 27int sysctl_dccp_feat_rx_ccid = DCCPF_INITIAL_CCID;
28int sysctl_dccp_feat_tx_ccid = DCCPF_INITIAL_CCID; 28int sysctl_dccp_feat_tx_ccid = DCCPF_INITIAL_CCID;
29int sysctl_dccp_feat_send_ack_vector = DCCPF_INITIAL_SEND_ACK_VECTOR;
30 29
31u64 dccp_decode_value_var(const u8 *bf, const u8 len) 30u64 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)
526int dccp_insert_options(struct sock *sk, struct sk_buff *skb) 524int 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;