[PATCH] AF_PACKET: Fix BPF handling.
commit6d2d108d66d02bc617e3cab2419fecf0e43afae6
authorDavid S. Miller <davem@sunset.davemloft.net>
Fri, 2 Feb 2007 21:06:03 +0000 (2 13:06 -0800)
committerChris Wright <chrisw@sous-sol.org>
Mon, 5 Feb 2007 16:31:45 +0000 (5 08:31 -0800)
tree567c9744592b879101801e3f484fdc8b97a52af0
parent05267c7fe2e451b3a18cebb506c4adde5edcf275
[PATCH] AF_PACKET: Fix BPF handling.

This fixes a bug introduced by:

commit fda9ef5d679b07c9d9097aaf6ef7f069d794a8f9
Author: Dmitry Mishin <dim@openvz.org>
Date:   Thu Aug 31 15:28:39 2006 -0700

    [NET]: Fix sk->sk_filter field access

sk_run_filter() returns either 0 or an unsigned 32-bit
length which says how much of the packet to retain.
If that 32-bit unsigned integer is larger than the packet,
this is fine we just leave the packet unchanged.

The above commit caused all filter return values which
were negative when interpreted as a signed integer to
indicate a packet drop, which is wrong.

Based upon a report and initial patch by Raivis Bucis.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
net/packet/af_packet.c