[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ack bug fix



Steve,

I figured I'd give it a try, after a bit of code and spec reading.
The attached fix seems to do the job.  Basically, it does what the
spec says: flip from CC to RUN state on the receipt of just about any
data-related message.  That involves moving the code you had outside
the check for "is this data rather than ack".

Patrick, the result seems to be a working rmtermd...

	paul
--- net/decnet/dn_nsp_in.c.orig	Sun Jan  9 00:36:20 2000
+++ net/decnet/dn_nsp_in.c	Wed Feb  2 17:16:50 2000
@@ -691,6 +691,13 @@
 	} else {
 		int other = 1;
 
+		/* both data and ack frames can kick a CC socket into RUN */
+		if ((scp->state == DN_CC) && !sk->dead) {
+			scp->state = DN_RUN;
+			sk->state = TCP_ESTABLISHED;
+			sk->state_change(sk);
+		}
+
 		if ((cb->nsp_flags & 0x1c) == 0)
 			other = 0;
 		if (cb->nsp_flags == 0x04)
@@ -706,16 +713,9 @@
 		/*
 		 * If we've some sort of data here then call a
 		 * suitable routine for dealing with it, otherwise
-		 * the packet is an ack and can be discarded. All
-		 * data frames can also kick a CC socket into RUN.
+		 * the packet is an ack and can be discarded.
 		 */
 		if ((cb->nsp_flags & 0x0c) == 0) {
-
-			if ((scp->state == DN_CC) && !sk->dead) {
-				scp->state = DN_RUN;
-				sk->state = TCP_ESTABLISHED;
-				sk->state_change(sk);
-			}
 
 			if (scp->state != DN_RUN)
 				goto free_out;