Commit 6935d46c authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[NET]: Remove redundant code in net/core/filter.c

skb_header_pointer handles linear and non-linear data, no need to handle
linear data again.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 55820ee2
...@@ -168,10 +168,6 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen) ...@@ -168,10 +168,6 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
case BPF_LD|BPF_W|BPF_ABS: case BPF_LD|BPF_W|BPF_ABS:
k = fentry->k; k = fentry->k;
load_w: load_w:
if (k >= 0 && (unsigned int)(k+sizeof(u32)) <= len) {
A = ntohl(*(u32*)&data[k]);
continue;
}
if (k < 0) { if (k < 0) {
u8 *ptr; u8 *ptr;
...@@ -194,10 +190,6 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen) ...@@ -194,10 +190,6 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
case BPF_LD|BPF_H|BPF_ABS: case BPF_LD|BPF_H|BPF_ABS:
k = fentry->k; k = fentry->k;
load_h: load_h:
if (k >= 0 && (unsigned int)(k + sizeof(u16)) <= len) {
A = ntohs(*(u16*)&data[k]);
continue;
}
if (k < 0) { if (k < 0) {
u8 *ptr; u8 *ptr;
...@@ -220,10 +212,6 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen) ...@@ -220,10 +212,6 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
case BPF_LD|BPF_B|BPF_ABS: case BPF_LD|BPF_B|BPF_ABS:
k = fentry->k; k = fentry->k;
load_b: load_b:
if (k >= 0 && (unsigned int)k < len) {
A = data[k];
continue;
}
if (k < 0) { if (k < 0) {
u8 *ptr; u8 *ptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment