[libss7-commits] mattf: trunk r163 - /trunk/mtp2.c

SVN commits to the libss7 project libss7-commits at lists.digium.com
Mon May 12 13:22:14 CDT 2008


Author: mattf
Date: Mon May 12 13:22:13 2008
New Revision: 163

URL: http://svn.digium.com/view/libss7?view=rev&rev=163
Log:
Add the write flag in a couple of more places that might need it.  Basically, it needs to be set any time any MTP2 parameter changes (bib, fib, fsn, bsn)

Modified:
    trunk/mtp2.c

Modified: trunk/mtp2.c
URL: http://svn.digium.com/view/libss7/trunk/mtp2.c?view=diff&rev=163&r1=162&r2=163
==============================================================================
--- trunk/mtp2.c (original)
+++ trunk/mtp2.c Mon May 12 13:22:13 2008
@@ -67,14 +67,18 @@
 
 static inline void init_mtp2_header(struct mtp2 *link, struct mtp_su_head *h, int new, int nack)
 {
-	if (new)
+	if (new) {
 		link->curfsn += 1;
+		link->flags |= MTP2_FLAG_WRITE;
+	}
 
 	h->fib = link->curfib;
 	h->fsn = link->curfsn;
 	
-	if (nack)
+	if (nack) {
 		link->curbib = !link->curbib;
+		link->flags |= MTP2_FLAG_WRITE;
+	}
 
 	h->bib = link->curbib;
 	h->bsn = link->lastfsnacked;
@@ -119,6 +123,7 @@
 	link->curbib = 1;
 	link->lastfsnacked = 127;
 	link->retransmissioncount = 0;
+	link->flags |= MTP2_FLAG_WRITE;
 
 	flush_bufs(link);
 }
@@ -676,6 +681,7 @@
 		mtp_message(link->master, "Received out of sequence MSU w/ fsn of %d, lastfsnacked = %d, requesting retransmission\n", h->fsn, link->lastfsnacked);
 		link->retransmissioncount++;
 		link->curbib = !link->curbib;
+		link->flags |= MTP2_FLAG_WRITE;
 		return 0;
 	}
 




More information about the libss7-commits mailing list