summaryrefslogtreecommitdiff
path: root/net/packet/af_packet.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-09-19 15:13:45 -0400
committerJeff Garzik <jeff@garzik.org>2006-09-19 15:13:45 -0400
commit23b6b0e3e8306ce3d00e0c87196bfaad335b9096 (patch)
tree3e690e564ac42444937b0d66b624c0e292d4a88a /net/packet/af_packet.c
parent8624a1c93772d24a38ed10cfcd290e8a18ac5b0a (diff)
parent47a5c6fa0e204a2b63309c648bb2fde36836c826 (diff)
Merge branch 'master' into upstream
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r--net/packet/af_packet.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index f9cef3671593..4172a5235916 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -626,8 +626,6 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
if ((int)snaplen < 0)
snaplen = 0;
}
- if (snaplen > skb->len-skb->data_len)
- snaplen = skb->len-skb->data_len;
spin_lock(&sk->sk_receive_queue.lock);
h = (struct tpacket_hdr *)packet_lookup_frame(po, po->head);
@@ -644,7 +642,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
status &= ~TP_STATUS_LOSING;
spin_unlock(&sk->sk_receive_queue.lock);
- memcpy((u8*)h + macoff, skb->data, snaplen);
+ skb_copy_bits(skb, 0, (u8*)h + macoff, snaplen);
h->tp_len = skb->len;
h->tp_snaplen = snaplen;