aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/input.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-08-21 05:36:45 -0300
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 16:03:42 -0700
commit03ace394ac9bcad38043a381ae5f4860b9c9fa1c (patch)
treebbe5f7fc56074224ded47113974dbc3db550b303 /net/dccp/input.c
parent[DCCP]: Give more info on Step 6 failure debug printk (diff)
downloadlinux-dev-03ace394ac9bcad38043a381ae5f4860b9c9fa1c.tar.xz
linux-dev-03ace394ac9bcad38043a381ae5f4860b9c9fa1c.zip
[DCCP]: Fix the ACK and SEQ window variables settings
This is from a first audit, more eyeballs are more than welcome. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/input.c')
-rw-r--r--net/dccp/input.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/net/dccp/input.c b/net/dccp/input.c
index ce8396b126d2..5847cf454e26 100644
--- a/net/dccp/input.c
+++ b/net/dccp/input.c
@@ -314,7 +314,19 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk,
}
dp->dccps_isr = DCCP_SKB_CB(skb)->dccpd_seq;
- dccp_update_gsr(sk, DCCP_SKB_CB(skb)->dccpd_seq);
+ dccp_update_gsr(sk, dp->dccps_isr);
+ /*
+ * SWL and AWL are initially adjusted so that they are not less than
+ * the initial Sequence Numbers received and sent, respectively:
+ * SWL := max(GSR + 1 - floor(W/4), ISR),
+ * AWL := max(GSS - W' + 1, ISS).
+ * These adjustments MUST be applied only at the beginning of the
+ * connection.
+ *
+ * AWL was adjusted in dccp_v4_connect -acme
+ */
+ dccp_set_seqno(&dp->dccps_swl,
+ max48(dp->dccps_swl, dp->dccps_isr));
if (ccid_hc_rx_init(dp->dccps_hc_rx_ccid, sk) != 0 ||
ccid_hc_tx_init(dp->dccps_hc_tx_ccid, sk) != 0) {