]> git.baikalelectronics.ru Git - kernel.git/commit
[AF_PACKET]: Fix BPF handling.
authorDavid S. Miller <davem@sunset.davemloft.net>
Wed, 24 Jan 2007 23:21:02 +0000 (15:21 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 24 Jan 2007 23:21:02 +0000 (15:21 -0800)
commit8f9224ec56417c035d30e0de46eedee7d7bd459b
treeb1c165e43ef28d9e22c118e8cbb983431ace3c7a
parentc7e7c5e82e209a02790f8dec94629d5263fc5438
[AF_PACKET]: Fix BPF handling.

This fixes a bug introduced by:

commit 63565c1c26347ae6f6ff488ff6a890181374b09a
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>
net/packet/af_packet.c