patch-2.4.22 linux-2.4.22/net/ax25/ax25_ip.c

Next file: linux-2.4.22/net/ax25/ax25_out.c
Previous file: linux-2.4.22/net/atm/svc.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/net/ax25/ax25_ip.c linux-2.4.22/net/ax25/ax25_ip.c
@@ -160,9 +160,15 @@
 				skb_set_owner_w(ourskb, skb->sk);
 
 			kfree_skb(skb);
-
-			src_c = *src;
-			dst_c = *dst;
+			/* dl9sau: bugfix
+			 * after kfree_skb(), dst and src which were pointer
+			 * to bp which is part of skb->data would not be valid
+			 * anymore hope that after skb_pull(ourskb, ..) our
+			 * dsc_c and src_c will not become invalid
+			 */
+			bp  = ourskb->data;
+			dst_c = *(ax25_address *)(bp + 1);
+			src_c = *(ax25_address *)(bp + 8);
 
 			skb_pull(ourskb, AX25_HEADER_LEN - 1);	/* Keep PID */
 			ourskb->nh.raw = ourskb->data;

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