[svn-commits] mattf: trunk r68 - /trunk/mtp2.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Nov 8 11:17:07 MST 2006


Author: mattf
Date: Wed Nov  8 12:17:06 2006
New Revision: 68

URL: http://svn.digium.com/view/libss7?rev=68&view=rev
Log:
Now we do retransmission requests on MSUs that we don't receive correctly!

Modified:
    trunk/mtp2.c

Modified: trunk/mtp2.c
URL: http://svn.digium.com/view/libss7/trunk/mtp2.c?rev=68&r1=67&r2=68&view=diff
==============================================================================
--- trunk/mtp2.c (original)
+++ trunk/mtp2.c Wed Nov  8 12:17:06 2006
@@ -666,6 +666,13 @@
 			mtp_error(link->master, "Received MSU in invalid state %d\n", link->state);
 			return -1;
 	}
+
+	/* If we're still waiting for our retranmission acknownledgement, we'll just ignore subsequent MSUs until it starts */
+	if (h->fib != link->curbib) {
+		mtp_message(link->master, "MSU received, though still waiting for retransmission start.  Dropping.\n");
+		return 0;
+	}
+
 	if (h->fsn == link->lastfsnacked) {
 		/* Discard */
 		mtp_message(link->master, "Received double MSU, dropping\n");
@@ -673,7 +680,8 @@
 	}
 
 	if (h->fsn != ((link->lastfsnacked+1) % 128)) {
-		mtp_message(link->master, "Received out of sequence MSU w/ fsn of %d, lastfsnacked = %d\n", h->fsn, link->lastfsnacked + 1);
+		mtp_message(link->master, "Received out of sequence MSU w/ fsn of %d, lastfsnacked = %d, requesting retransmission\n", h->fsn, link->lastfsnacked);
+		link->curbib = !link->curbib;
 		return 0;
 	}
 



More information about the svn-commits mailing list