diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2005-09-05 18:44:37 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-09-05 18:44:37 -0700 |
commit | 1198ad002ad36291817c7bf0308ab9c50ee2571d (patch) | |
tree | 2f187aa97c6ea0dd21dee393c9eb68ecc85f9461 /net | |
parent | 6baf1f417d092bd2de7c8892cecad456024c993f (diff) | |
download | linux-stable-1198ad002ad36291817c7bf0308ab9c50ee2571d.tar.gz linux-stable-1198ad002ad36291817c7bf0308ab9c50ee2571d.tar.bz2 linux-stable-1198ad002ad36291817c7bf0308ab9c50ee2571d.zip |
[NET]: 2.6.13 breaks libpcap (and tcpdump)
Patrick McHardy says:
Never mind, I got it, we never fall through to the second switch
statement anymore. I think we could simply break when load_pointer
returns NULL. The switch statement will fall through to the default
case and return 0 for all cases but 0 > k >= SKF_AD_OFF.
Here's a patch to do just that.
I left BPF_MSH alone because it's really a hack to calculate the IP
header length, which makes no sense when applied to the special data.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/filter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index cd91a24f9720..079c2edff789 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -182,7 +182,7 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen) A = ntohl(*(u32 *)ptr); continue; } - return 0; + break; case BPF_LD|BPF_H|BPF_ABS: k = fentry->k; load_h: @@ -191,7 +191,7 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen) A = ntohs(*(u16 *)ptr); continue; } - return 0; + break; case BPF_LD|BPF_B|BPF_ABS: k = fentry->k; load_b: @@ -200,7 +200,7 @@ load_b: A = *(u8 *)ptr; continue; } - return 0; + break; case BPF_LD|BPF_W|BPF_LEN: A = skb->len; continue; |