patch-2.1.25 linux/net/lapb/lapb_iface.c

Next file: linux/net/lapb/lapb_in.c
Previous file: linux/net/ipv6/tcp_ipv6.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.24/linux/net/lapb/lapb_iface.c linux/net/lapb/lapb_iface.c
@@ -49,8 +49,6 @@
  */
 static void lapb_free_cb(lapb_cb *lapb)
 {
-	del_timer(&lapb->timer);
-
 	kfree_s(lapb, sizeof(lapb_cb));
 
 	MOD_DEC_USE_COUNT;
@@ -161,6 +159,10 @@
 
 	lapb_insert_cb(lapb);
 
+	lapb->t1timer = lapb->t1;
+
+	lapb_set_timer(lapb);
+
 	return LAPB_OK;
 }
 
@@ -171,6 +173,8 @@
 	if ((lapb = lapb_tokentostruct(token)) == NULL)
 		return LAPB_BADTOKEN;
 
+	del_timer(&lapb->timer);
+
 	lapb_clear_queues(lapb);
 
 	lapb_remove_cb(lapb);
@@ -225,14 +229,8 @@
 				return LAPB_INVALUE;
 		}
 
-		lapb->mode   = parms->mode;
-		lapb->window = parms->window;
-
-		if (lapb->mode & LAPB_DCE) {
-			lapb_set_timer(lapb);
-		} else {
-			lapb->t1timer = 0;
-		}
+		lapb->mode    = parms->mode;
+		lapb->window  = parms->window;
 	}
 
 	lapb->t1    = parms->t1;
@@ -265,8 +263,6 @@
 
 	lapb->state = LAPB_STATE_1;
 
-	lapb_set_timer(lapb);
-
 	return LAPB_OK;
 }
 	
@@ -290,7 +286,7 @@
 #endif
 			lapb_send_control(lapb, LAPB_DISC, LAPB_POLLON, LAPB_COMMAND);
 			lapb->state   = LAPB_STATE_0;
-			lapb->t1timer = (lapb->mode & LAPB_DCE) ? lapb->t1 : 0;
+			lapb->t1timer = lapb->t1;
 			return LAPB_NOTCONNECTED;
 
 		case LAPB_STATE_2:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov