X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fpacket%2Faf_packet.c;fp=net%2Fpacket%2Faf_packet.c;h=4172a5235916e3f71ee6fbed85b4c296ab9de3c4;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=9db7dbdb16e6bd14c7ca23dc6c8dfe11e16f4566;hpb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;p=linux-2.6.git diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 9db7dbdb1..4172a5235 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -49,7 +49,6 @@ * */ -#include #include #include #include @@ -627,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); @@ -645,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;