提交 3154e540 编写于 作者: P Patrick McHardy 提交者: David S. Miller

[NET]: net/core/filter.c: make len cover the entire packet

As suggested by Herbert Xu:

Since we don't require anything to be in the linear packet range
anymore make len cover the entire packet.
Signed-off-by: NPatrick McHardy <kaber@trash.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0b05b2a4
......@@ -76,10 +76,6 @@ static inline void *load_pointer(struct sk_buff *skb, int k,
int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
{
/* len is UNSIGNED. Byte wide insns relies only on implicit
type casts to prevent reading arbitrary memory locations.
*/
unsigned int len = skb->len-skb->data_len;
struct sock_filter *fentry; /* We walk down these */
void *ptr;
u32 A = 0; /* Accumulator */
......@@ -206,10 +202,10 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
}
return 0;
case BPF_LD|BPF_W|BPF_LEN:
A = len;
A = skb->len;
continue;
case BPF_LDX|BPF_W|BPF_LEN:
X = len;
X = skb->len;
continue;
case BPF_LD|BPF_W|BPF_IND:
k = X + fentry->k;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册