[PATCH] IPoIB: set skb->mac.raw on receive

Set skb->mac.raw on receive.  This fixes crashes when this is
dereferenced, for example by netfilter or when PF_PACKET is used.

Signed-off-by: Hal Rosenstock <halr@voltaire.com>
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Hal Rosenstock 2005-04-16 15:26:05 -07:00 committed by Linus Torvalds
parent 48a5346b31
commit 62241eb497
1 changed files with 1 additions and 1 deletions

View File

@ -201,7 +201,7 @@ static void ipoib_ib_handle_wc(struct net_device *dev,
if (wc->slid != priv->local_lid ||
wc->src_qp != priv->qp->qp_num) {
skb->protocol = ((struct ipoib_header *) skb->data)->proto;
skb->mac.raw = skb->data;
skb_pull(skb, IPOIB_ENCAP_LEN);
dev->last_rx = jiffies;