From 03ace394ac9bcad38043a381ae5f4860b9c9fa1c Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Sun, 21 Aug 2005 05:36:45 -0300 Subject: [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 Signed-off-by: David S. Miller --- net/dccp/ipv4.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'net/dccp/ipv4.c') diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 02ebf1f39f3..647e669a126 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -309,6 +309,16 @@ static int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, usin->sin_port); dccp_update_gss(sk, dp->dccps_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(&dp->dccps_awl, max48(dp->dccps_awl, dp->dccps_iss)); + inet->id = dp->dccps_iss ^ jiffies; err = dccp_connect(sk); -- cgit v1.2.3