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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Nov 17 15:26:42 CST 2007


Author: mattf
Date: Sat Nov 17 15:26:41 2007
New Revision: 132

URL: http://svn.digium.com/view/libss7?view=rev&rev=132
Log:
Make sure we retry realignment when we go down

Modified:
    trunk/mtp2.c

Modified: trunk/mtp2.c
URL: http://svn.digium.com/view/libss7/trunk/mtp2.c?view=diff&rev=132&r1=131&r2=132
==============================================================================
--- trunk/mtp2.c (original)
+++ trunk/mtp2.c Sat Nov 17 15:26:41 2007
@@ -451,6 +451,8 @@
 		return -1;
 	}
 
+	mtp2_setstate(link, MTP_NOTALIGNED);
+
 	return 0;
 }
 
@@ -474,9 +476,7 @@
 			ss7_schedule_del(link->master, &link->t2);
 			switch (newstate) {
 				case MTP_IDLE:
-					if (to_idle(link))
-						return -1;
-					break;
+					return to_idle(link);
 				case MTP_ALIGNED:
 				case MTP_PROVING:
 					if (newstate == MTP_ALIGNED)
@@ -503,9 +503,7 @@
 
 			switch (newstate) {
 				case MTP_IDLE:
-					if (to_idle(link))
-						return -1;
-					break;
+					return to_idle(link);
 				case MTP_PROVING:
 					link->t4 = ss7_schedule_event(link->master, link->provingperiod, t4_expiry, link);
 			}
@@ -516,9 +514,7 @@
 
 			switch (newstate) {
 				case MTP_IDLE:
-					if (to_idle(link))
-						return -1;
-					break;
+					return to_idle(link);
 				case MTP_PROVING:
 					link->t4 = ss7_schedule_event(link->master, link->provingperiod, t4_expiry, link);
 					break;
@@ -550,9 +546,7 @@
 			/* Our timer expired, it should be cleaned up already */
 			switch (newstate) {
 				case MTP_IDLE:
-					if (to_idle(link))
-						return -1;
-					break;
+					return to_idle(link);
 				case MTP_ALIGNEDREADY:
 					link->t1 = ss7_schedule_event(link->master, link->timers.t1, t1_expiry, link);
 					if (mtp2_fisu(link, 0)) {
@@ -642,6 +636,8 @@
 			break;
 		case MTP_ALIGNEDREADY:
 		case MTP_INSERVICE:
+			if ((lssutype != LSSU_SIOS) && (lssutype != LSSU_SIO))
+				mtp_message(link->master, "Got LSSU of type %d while link is in state %d.  Re-Aligning\n", lssutype, link->state);
 			return mtp2_setstate(link, MTP_IDLE);
 
 	}




More information about the svn-commits mailing list