aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv4.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-09-18 00:17:51 -0700
committerDavid S. Miller <davem@davemloft.net>2005-09-18 00:17:51 -0700
commitae31c3399d17b1f7bc1742724f70476b5417744f (patch)
treec34099afb228936672e6e589f0af7d81f1f62443 /net/dccp/ipv4.c
parentMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 (diff)
downloadlinux-dev-ae31c3399d17b1f7bc1742724f70476b5417744f.tar.xz
linux-dev-ae31c3399d17b1f7bc1742724f70476b5417744f.zip
[DCCP]: Move the ack vector code to net/dccp/ackvec.[ch]
Isolating it, that will be used when we introduce a CCID2 (TCP-Like) implementation. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r--net/dccp/ipv4.c59
1 files changed, 12 insertions, 47 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 94a440b2685b..82434e4a42df 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -23,6 +23,7 @@
#include <net/tcp_states.h>
#include <net/xfrm.h>
+#include "ackvec.h"
#include "ccid.h"
#include "dccp.h"
@@ -1112,45 +1113,7 @@ int dccp_v4_rcv(struct sk_buff *skb)
goto discard_it;
dh = dccp_hdr(skb);
-#if 0
- /*
- * Use something like this to simulate some DATA/DATAACK loss to test
- * dccp_ackpkts_add, you'll get something like this on a session that
- * sends 10 DATA/DATAACK packets:
- *
- * ackpkts_print: 281473596467422 |0,0|3,0|0,0|3,0|0,0|3,0|0,0|3,0|0,1|
- *
- * 0, 0 means: DCCP_ACKPKTS_STATE_RECEIVED, RLE == just this packet
- * 0, 1 means: DCCP_ACKPKTS_STATE_RECEIVED, RLE == two adjacent packets
- * with the same state
- * 3, 0 means: DCCP_ACKPKTS_STATE_NOT_RECEIVED, RLE == just this packet
- *
- * So...
- *
- * 281473596467422 was received
- * 281473596467421 was not received
- * 281473596467420 was received
- * 281473596467419 was not received
- * 281473596467418 was received
- * 281473596467417 was not received
- * 281473596467416 was received
- * 281473596467415 was not received
- * 281473596467414 was received
- * 281473596467413 was received (this one was the 3way handshake
- * RESPONSE)
- *
- */
- if (dh->dccph_type == DCCP_PKT_DATA ||
- dh->dccph_type == DCCP_PKT_DATAACK) {
- static int discard = 0;
- if (discard) {
- discard = 0;
- goto discard_it;
- }
- discard = 1;
- }
-#endif
DCCP_SKB_CB(skb)->dccpd_seq = dccp_hdr_seq(skb);
DCCP_SKB_CB(skb)->dccpd_type = dh->dccph_type;
@@ -1264,11 +1227,9 @@ static int dccp_v4_init_sock(struct sock *sk)
do_gettimeofday(&dp->dccps_epoch);
if (dp->dccps_options.dccpo_send_ack_vector) {
- dp->dccps_hc_rx_ackpkts =
- dccp_ackpkts_alloc(DCCP_MAX_ACK_VECTOR_LEN,
- GFP_KERNEL);
-
- if (dp->dccps_hc_rx_ackpkts == NULL)
+ dp->dccps_hc_rx_ackvec = dccp_ackvec_alloc(DCCP_MAX_ACKVEC_LEN,
+ GFP_KERNEL);
+ if (dp->dccps_hc_rx_ackvec == NULL)
return -ENOMEM;
}
@@ -1288,8 +1249,10 @@ static int dccp_v4_init_sock(struct sock *sk)
dp->dccps_hc_tx_ccid == NULL) {
ccid_exit(dp->dccps_hc_rx_ccid, sk);
ccid_exit(dp->dccps_hc_tx_ccid, sk);
- dccp_ackpkts_free(dp->dccps_hc_rx_ackpkts);
- dp->dccps_hc_rx_ackpkts = NULL;
+ if (dp->dccps_options.dccpo_send_ack_vector) {
+ dccp_ackvec_free(dp->dccps_hc_rx_ackvec);
+ dp->dccps_hc_rx_ackvec = NULL;
+ }
dp->dccps_hc_rx_ccid = dp->dccps_hc_tx_ccid = NULL;
return -ENOMEM;
}
@@ -1331,8 +1294,10 @@ static int dccp_v4_destroy_sock(struct sock *sk)
ccid_hc_rx_exit(dp->dccps_hc_rx_ccid, sk);
ccid_hc_tx_exit(dp->dccps_hc_tx_ccid, sk);
- dccp_ackpkts_free(dp->dccps_hc_rx_ackpkts);
- dp->dccps_hc_rx_ackpkts = NULL;
+ if (dp->dccps_options.dccpo_send_ack_vector) {
+ dccp_ackvec_free(dp->dccps_hc_rx_ackvec);
+ dp->dccps_hc_rx_ackvec = NULL;
+ }
ccid_exit(dp->dccps_hc_rx_ccid, sk);
ccid_exit(dp->dccps_hc_tx_ccid, sk);
dp->dccps_hc_rx_ccid = dp->dccps_hc_tx_ccid = NULL;