patch-2.2.13 linux/net/ax25/ax25_timer.c

Next file: linux/net/core/dev.c
Previous file: linux/net/ax25/af_ax25.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.12/linux/net/ax25/ax25_timer.c linux/net/ax25/ax25_timer.c
@@ -22,6 +22,7 @@
  *			Joerg(DL1BKE)	Fixed DAMA Slave. We are *required* to start with
  *					standard AX.25 mode.
  *	AX.25 037	Jonathan(G4KLX)	New timer architecture.
+ *                      Tomi(OH2BNS)    Fixed heartbeat expiry (check ax25_dev).
  */
 
 #include <linux/config.h>
@@ -153,8 +154,12 @@
 static void ax25_heartbeat_expiry(unsigned long param)
 {
 	ax25_cb *ax25 = (ax25_cb *)param;
+	int proto = AX25_PROTO_STD_SIMPLEX;
 
-	switch (ax25->ax25_dev->values[AX25_VALUES_PROTOCOL]) {
+	if (ax25->ax25_dev)
+		proto = ax25->ax25_dev->values[AX25_VALUES_PROTOCOL];
+
+	switch (proto) {
 		case AX25_PROTO_STD_SIMPLEX:
 		case AX25_PROTO_STD_DUPLEX:
 			ax25_std_heartbeat_expiry(ax25);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)