patch-1.3.6 linux/net/ax25/ax25_in.c

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

diff -u --recursive --new-file v1.3.5/linux/net/ax25/ax25_in.c linux/net/ax25/ax25_in.c
@@ -72,8 +72,7 @@
 #ifdef CONFIG_INET
 		case AX25_P_IP:
 			ax25_ip_mode_set(&ax25->dest_addr, ax25->device, 'V');
-			skb->h.raw = ((char *)(iframe)) + 2;
-			skb->len  -= 2;
+			skb->h.raw = skb->data;
 			ip_rcv(skb, skb->dev, NULL);	/* Wrong ptype */
 			queued = 1;
 			break;
@@ -559,6 +558,12 @@
 	int queued = 0, frametype;
 	unsigned char *frame;
 
+	if (ax25->state != AX25_STATE_1 && ax25->state != AX25_STATE_2 &&
+	    ax25->state != AX25_STATE_3 && ax25->state != AX25_STATE_4) {
+		printk("ax25_process_rx_frame: frame received - state = %d\n", ax25->state);
+		return queued;
+	}
+
 	del_timer(&ax25->timer);
 
 	frame = skb->h.raw;
@@ -578,14 +583,11 @@
 		case AX25_STATE_4:
 			queued = ax25_state4_machine(ax25, skb, frame, frametype, type);
 			break;
-		default:
-			printk("ax25_process_rx_frame: frame received - state = %d\n", ax25->state);
-			break;
 	}
 
 	ax25_set_timer(ax25);
 
-	return(queued);
+	return queued;
 }
 
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this