summaryrefslogtreecommitdiffstats
path: root/net/dccp/minisocks.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-08-21 10:36:45 +0200
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-30 01:03:42 +0200
commit03ace394ac9bcad38043a381ae5f4860b9c9fa1c (patch)
treebbe5f7fc56074224ded47113974dbc3db550b303 /net/dccp/minisocks.c
parent[DCCP]: Give more info on Step 6 failure debug printk (diff)
downloadlinux-03ace394ac9bcad38043a381ae5f4860b9c9fa1c.tar.xz
linux-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/minisocks.c')
-rw-r--r--net/dccp/minisocks.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c
index b8e67207e97e..ce5dff4ac22e 100644
--- a/net/dccp/minisocks.c
+++ b/net/dccp/minisocks.c
@@ -146,6 +146,19 @@ out_free:
newdp->dccps_iss = dreq->dreq_iss;
dccp_update_gss(newsk, dreq->dreq_iss);
+ /*
+ * 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.
+ */
+ dccp_set_seqno(&newdp->dccps_swl,
+ max48(newdp->dccps_swl, newdp->dccps_isr));
+ dccp_set_seqno(&newdp->dccps_awl,
+ max48(newdp->dccps_awl, newdp->dccps_iss));
+
dccp_init_xmit_timers(newsk);
DCCP_INC_STATS_BH(DCCP_MIB_PASSIVEOPENS);