]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[AX.25]: Fix packet socket crash
authorRalf Baechle <ralf@linux-mips.org>
Wed, 5 Oct 2005 19:16:04 +0000 (12:16 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Oct 2005 19:16:04 +0000 (12:16 -0700)
Since changeset 98a82febb6340466824c3a453738d4fbd05db81a AX.25 is passing
received IP and ARP packets to the stack through netif_rx() but we don't
set the skb->mac.raw to right value which may result in a crash with
applications that use a packet socket.

Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ax25/ax25_in.c
net/netrom/nr_dev.c

index 810c9c76c2e022b08d171e255a0bf1340159f97f..73cfc3411c461d50d7dbb7d718dd3e2315d26428 100644 (file)
@@ -123,7 +123,7 @@ int ax25_rx_iframe(ax25_cb *ax25, struct sk_buff *skb)
                }
 
                skb_pull(skb, 1);       /* Remove PID */
-               skb->h.raw    = skb->data;
+               skb->mac.raw  = skb->nh.raw;
                skb->nh.raw   = skb->data;
                skb->dev      = ax25->ax25_dev->dev;
                skb->pkt_type = PACKET_HOST;
index 4e66eef9a03479f0ead803fabdfb3d1f73e0b18f..509afddae5694a4aae228127c2e379f618bdd40a 100644 (file)
@@ -58,7 +58,7 @@ int nr_rx_ip(struct sk_buff *skb, struct net_device *dev)
 
        /* Spoof incoming device */
        skb->dev      = dev;
-       skb->h.raw    = skb->data;
+       skb->mac.raw  = skb->nh.raw;
        skb->nh.raw   = skb->data;
        skb->pkt_type = PACKET_HOST;