Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jun 1998 18:52:42 +0200
From:      dirk.meyer@dinoex.sub.org (Dirk Meyer)
To:        freebsd-isdn@FreeBSD.ORG
Subject:   Re: isdn-subsystem hangs with 0.61
Message-ID:  <HjmeRA05FB@dmeyer.dinoex.sub.org>
References:  <pR4W%2B7AK9Y@dmeyer.dinoex.sub.org> <m0yk1r7-000007C@bert.kts.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello,

i think i found a bug in layer2:
the check for the isdn-frame-nr complies
if 0 follows 127.
my old Q921 don't handle the case,
but i think its leagal to accept this.
here is a workaround that fix it.
It worked fine today ( 2 rounds).

kind regards Dirk

-- Dirk Meyer, Im Grund 4, 34317 Habichtswald, Tel 05606/6512 Q (voice)
-- Origin: DINOEX Habichtswald  -FRG-  [dirk.meyer@dinoex.sub.org]

--- layer2/i4b_iframe.c.orig	Wed Apr  1 17:07:06 1998
+++ layer2/i4b_iframe.c	Mon Jun 15 22:57:25 1998
@@ -176,7 +176,7 @@
 
 	/* sequence numbers as expected ? */
 	
-	if((l2sc->va <= nr) && (nr <= l2sc->vs))
+	if ( i4b_l2_sequence( nr, l2sc->va, l2sc->vs ) == 0 )
 	{
 		if(l2sc->Q921_state == ST_TIMREC)
 		{
--- layer2/i4b_l2.h.orig	Fri May  1 19:23:36 1998
+++ layer2/i4b_l2.h	Mon Jun 15 23:07:23 1998
@@ -306,6 +306,7 @@
 extern void i4b_invoke_retransmission ( l2_softc_t *l2sc, int nr );
 extern void i4b_i_frame_queued_up ( l2_softc_t *l2sc );
 extern void i4b_l1_activate ( l2_softc_t *l2sc );
+extern int i4b_l2_sequence ( int nr, int va, int vs );
 extern void i4b_make_rand_ri ( l2_softc_t *l2sc );
 extern void i4b_mdl_assign_ind ( l2_softc_t *l2sc );
 extern void i4b_mdl_error_ind ( l2_softc_t *l2sc, char *where, int errorcode );
--- layer2/i4b_l2fsm.c.orig	Fri May  1 19:23:38 1998
+++ layer2/i4b_l2fsm.c	Mon Jun 15 23:03:12 1998
@@ -1085,7 +1085,7 @@
 		}
 	}
 
-	if((l2sc->va <= l2sc->rxd_NR) && (l2sc->rxd_NR <= l2sc->vs))
+	if ( i4b_l2_sequence( l2sc->rxd_NR, l2sc->va, l2sc->vs ) == 0 )
 	{
 		if(l2sc->rxd_NR == l2sc->vs)
 		{
@@ -1132,7 +1132,7 @@
 		}
 	}
 
-	if((l2sc->va <= l2sc->rxd_NR) && (l2sc->rxd_NR <= l2sc->vs))
+	if ( i4b_l2_sequence( l2sc->rxd_NR, l2sc->va, l2sc->vs ) == 0 )
 	{
 		l2sc->va = l2sc->rxd_NR;
 		i4b_T200_stop(l2sc);
@@ -1172,7 +1172,7 @@
                 }
         }
 
-        if((l2sc->va <= l2sc->rxd_NR) && (l2sc->rxd_NR <= l2sc->vs))
+	if ( i4b_l2_sequence( l2sc->rxd_NR, l2sc->va, l2sc->vs ) == 0 )
         {
                 l2sc->va = l2sc->rxd_NR;
                 i4b_T203_stop(l2sc);
@@ -1446,7 +1446,8 @@
 	{
 		if(l2sc->rxd_PF == 1)
 		{
-			if((l2sc->va <= l2sc->rxd_NR) && (l2sc->rxd_NR <= l2sc->vs))
+			if ( i4b_l2_sequence( l2sc->rxd_NR,
+						l2sc->va, l2sc->vs ) == 0 )
 			{
 				l2sc->va = l2sc->rxd_NR;
 				i4b_T200_stop(l2sc);
@@ -1464,7 +1465,7 @@
 		}
 	}
 
-	if((l2sc->va <= l2sc->rxd_NR) && (l2sc->rxd_NR <= l2sc->vs))
+	if ( i4b_l2_sequence( l2sc->rxd_NR, l2sc->va, l2sc->vs ) == 0 )
 	{
 		l2sc->va = l2sc->rxd_NR;
 		l2sc->Q921_state = ST_TIMREC;
@@ -1497,7 +1498,8 @@
 	{
 		if(l2sc->rxd_PF == 1)
 		{
-			if((l2sc->va <= l2sc->rxd_NR) && (l2sc->rxd_NR <= l2sc->vs))
+			if ( i4b_l2_sequence( l2sc->rxd_NR,
+						l2sc->va, l2sc->vs ) == 0 )
 			{
 				l2sc->va = l2sc->rxd_NR;
 				i4b_T200_stop(l2sc);
@@ -1515,7 +1517,7 @@
 		}
 	}
 
-	if((l2sc->va <= l2sc->rxd_NR) && (l2sc->rxd_NR <= l2sc->vs))
+	if ( i4b_l2_sequence( l2sc->rxd_NR, l2sc->va, l2sc->vs ) == 0 )
 	{
 		l2sc->va = l2sc->rxd_NR;
 		l2sc->Q921_state = ST_TIMREC;
@@ -1548,7 +1550,8 @@
 	{
 		if(l2sc->rxd_PF == 1)
 		{
-			if((l2sc->va <= l2sc->rxd_NR) && (l2sc->rxd_NR <= l2sc->vs))
+			if ( i4b_l2_sequence( l2sc->rxd_NR,
+						l2sc->va, l2sc->vs ) == 0 )
 			{
 				l2sc->va = l2sc->rxd_NR;
 				i4b_T200_restart(l2sc);
@@ -1565,7 +1568,7 @@
 		}
 	}
 
-	if((l2sc->va <= l2sc->rxd_NR) && (l2sc->rxd_NR <= l2sc->vs))
+	if ( i4b_l2_sequence( l2sc->rxd_NR, l2sc->va, l2sc->vs ) == 0 )
 	{
 		l2sc->va = l2sc->rxd_NR;
 		l2sc->Q921_state = ST_TIMREC;
--- layer2/i4b_util.c.orig	Fri May  1 19:23:41 1998
+++ layer2/i4b_util.c	Mon Jun 15 23:07:02 1998
@@ -293,6 +293,37 @@
 		PH_Act_Req(l2sc->unit);
 	}
 };
+
+/*---------------------------------------------------------------------------*
+ *	check for sequence nr
+ *---------------------------------------------------------------------------*/
+int
+i4b_l2_sequence(int nr, int va, int vs)
+		/* nr = receive sequence frame counter */
+		/* va = transmit sequence frame counter */
+		/* vs = acknowledge sequence frame counter */
+/*
+	check vor expected sequence nr
+	and care for overun of the number
+*/
+{
+	/* we got an 0, the last transmit frame could have 0x7f */
+	if ( va > nr )
+	{
+		if ( ( nr != 0 ) || ( va != 0x7f ) )
+			return 1;
+		/* we got an 0, the last transmit frame had 0x7f, ok */
+	};
+	/* we got an 0x7f, the new ack frame could have 0 */
+	if ( nr > vs )
+	{
+		if ( ( vs != 0 ) || ( nr != 0x7f ) )
+			return 1;
+		/* we got an 0x7f, the new ack frame had 0, ok */
+	};
+	/* all in range */
+	return 0;
+}
 	
 #endif /* NI4BQ921 > 0 */
 
--- logs with 0.62 without patch ---

Jun 15 16:30:07 pma-online isdnd[61]: DMN rate=90 sec/unit (day=1, beg=9, end=18, current=16)
Jun 15 16:34:32 pma-online isdnd[61]: DMN rate=90 sec/unit (day=1, beg=9, end=18, current=16)
Jun 15 16:44:59 pma-online /kernel: i4b-L2-i4b_mdl_error_ind: unit = 0, location = i4b_nr_error_recovery
Jun 15 16:44:59 pma-online /kernel: i4b-L2-i4b_mdl_error_ind: error = MDL_ERR_J: other error - N(R) error
Jun 15 16:44:59 pma-online /kernel: i4b-L2-i4b_mdl_error_ind: unit = 0, location = F_MF07
Jun 15 16:44:59 pma-online /kernel: i4b-L2-i4b_mdl_error_ind: error = MDL_ERR_F: peer initiated re-establishment - SABME
Jun 15 16:45:03 pma-online /kernel: i4b-L3-F_UEM: FSM function F_UEM executing, state = ST_U1 - Out Init
Jun 15 16:45:03 pma-online /kernel: i4b-L3-i4b_l3_tx_status: tx STATUS for cr 65
Jun 15 16:45:29 pma-online /kernel: i4b-L3-T305_timeout: DISC not answered, cr = 65
Jun 15 16:45:29 pma-online /kernel: i4b-L3-next_l3state: FSM illegal state, state = ST_U1 - Out Init, event = EV_T305EXP - T305 timeout!
Jun 15 17:36:38 pma-online /kernel: i4b-L3-T305_timeout: DISC not answered, cr = 65
Jun 15 17:37:00 pma-online isdnd[61]: DMN rate=90 sec/unit (day=1, beg=9, end=18, current=17)

-- NT->TE - unit:0 - frame:005796 - time:15.06 16:44:59.01 - length:4 ----------
Dump:000  02 81 01 ff                                           ....
Q921: SAP=0 (Call Control), C, TEI=64, S-Frame: RR N(R) 127 PF 1 

-- TE->NT - unit:0 - frame:005797 - time:15.06 16:44:59.01 - length:4 ----------
Dump:000  02 81 01 ff                                           ....
Q921: SAP=0 (Call Control), R, TEI=64, S-Frame: RR N(R) 127 PF 1 

-- TE->NT - unit:0 - frame:005798 - time:15.06 16:44:59.19 - length:12 ---------
Dump:000  00 81 fe fe                                           ....
Q921: SAP=0 (Call Control), C, TEI=64, I-Frame: N(S) 127 N(R) 127 P 0 
Dump:004  08 01 41 45 08 02 80 90                               ..AE....
Q931: pd=Q.931/I.451, cr=0x41 (from origination), message=DISCONNECT: 
     [cause: 16: Normal call clearing (Q.850) 
          (location=user, std=CCITT)]

-- NT->TE - unit:0 - frame:005799 - time:15.06 16:44:59.20 - length:4 ----------
Dump:000  00 81 01 00                                           ....
Q921: SAP=0 (Call Control), R, TEI=64, S-Frame: RR N(R) 0 PF 0 

-- TE->NT - unit:0 - frame:005800 - time:15.06 16:44:59.21 - length:3 ----------
Dump:000  00 81 7f                                              ...
Q921: SAP=0 (Call Control), C, TEI=64, U-Frame: SABME PF 1 

-- NT->TE - unit:0 - frame:005801 - time:15.06 16:44:59.22 - length:3 ----------
Dump:000  00 81 73                                              ..s
Q921: SAP=0 (Call Control), R, TEI=64, U-Frame: UA PF 1 

-- NT->TE - unit:0 - frame:005802 - time:15.06 16:44:59.33 - length:12 ---------
Dump:000  02 81 00 00                                           ....
Q921: SAP=0 (Call Control), C, TEI=64, I-Frame: N(S) 0 N(R) 0 P 0 
Dump:004  08 01 c1 4d 08 02 80 90                               ...M....
Q931: pd=Q.931/I.451, cr=0x41 (from destination), message=RELEASE: 
     [cause: 16: Normal call clearing (Q.850) 
          (location=user, std=CCITT)]

-- TE->NT - unit:0 - frame:005803 - time:15.06 16:44:59.33 - length:4 ----------
Dump:000  02 81 09 fe                                           ....
Q921: SAP=0 (Call Control), R, TEI=64, S-Frame: REJ N(R) 127 PF 0 

-- NT->TE - unit:0 - frame:005804 - time:15.06 16:44:59.35 - length:3 ----------
Dump:000  02 81 7f                                              ...
Q921: SAP=0 (Call Control), C, TEI=64, U-Frame: SABME PF 1 

-- TE->NT - unit:0 - frame:005805 - time:15.06 16:44:59.35 - length:3 ----------
Dump:000  02 81 73                                              ..s
Q921: SAP=0 (Call Control), R, TEI=64, U-Frame: UA PF 1 

-- NT->TE - unit:0 - frame:005806 - time:15.06 16:45:03.33 - length:12 ---------
Dump:000  02 81 00 00                                           ....
Q921: SAP=0 (Call Control), C, TEI=64, I-Frame: N(S) 0 N(R) 0 P 0 
Dump:004  08 01 c1 4d 08 02 80 90                               ...M....
Q931: pd=Q.931/I.451, cr=0x41 (from destination), message=RELEASE: 
     [cause: 16: Normal call clearing (Q.850) 
          (location=user, std=CCITT)]

-- TE->NT - unit:0 - frame:005807 - time:15.06 16:45:03.33 - length:15 ---------
Dump:000  00 81 00 02                                           ....
Q921: SAP=0 (Call Control), C, TEI=64, I-Frame: N(S) 0 N(R) 1 P 0 
Dump:004  08 01 41 7d 08 02 80 90 14 01 01                      ..A}.......
Q931: pd=Q.931/I.451, cr=0x41 (from origination), message=STATUS: 
     [cause: 16: Normal call clearing (Q.850) 
          (location=user, std=CCITT)]
     [call state: Std=CCITT, State=Call initiated]

-- NT->TE - unit:0 - frame:005808 - time:15.06 16:45:03.35 - length:4 ----------
Dump:000  00 81 01 02                                           ....
Q921: SAP=0 (Call Control), R, TEI=64, S-Frame: RR N(R) 1 PF 0 

-- NT->TE - unit:0 - frame:005809 - time:15.06 16:45:11.35 - length:4 ----------
Dump:000  02 81 01 03                                           ....
Q921: SAP=0 (Call Control), C, TEI=64, S-Frame: RR N(R) 1 PF 1 

-- TE->NT - unit:0 - frame:005810 - time:15.06 16:45:11.35 - length:4 ----------
Dump:000  02 81 01 03                                           ....
Q921: SAP=0 (Call Control), R, TEI=64, S-Frame: RR N(R) 1 PF 1 


.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isdn" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?HjmeRA05FB>