Skip to content

Commit

Permalink
[AX.25]: Fix packet socket crash
Browse files Browse the repository at this point in the history
Since changeset 98a82fe 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>
  • Loading branch information
Ralf Baechle authored and David S. Miller committed Oct 5, 2005
1 parent 77d8d7a commit 3a867b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/ax25/ax25_in.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion net/netrom/nr_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3a867b3

Please sign in to comment.