aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-09-05 21:44:37 -0400
committerDavid S. Miller <davem@davemloft.net>2005-09-05 21:44:37 -0400
commit1198ad002ad36291817c7bf0308ab9c50ee2571d (patch)
tree2f187aa97c6ea0dd21dee393c9eb68ecc85f9461 /net/core
parent6baf1f417d092bd2de7c8892cecad456024c993f (diff)
[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/core')
-rw-r--r--net/core/filter.c6
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)
182 A = ntohl(*(u32 *)ptr); 182 A = ntohl(*(u32 *)ptr);
183 continue; 183 continue;
184 } 184 }
185 return 0; 185 break;
186 case BPF_LD|BPF_H|BPF_ABS: 186 case BPF_LD|BPF_H|BPF_ABS:
187 k = fentry->k; 187 k = fentry->k;
188 load_h: 188 load_h:
@@ -191,7 +191,7 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
191 A = ntohs(*(u16 *)ptr); 191 A = ntohs(*(u16 *)ptr);
192 continue; 192 continue;
193 } 193 }
194 return 0; 194 break;
195 case BPF_LD|BPF_B|BPF_ABS: 195 case BPF_LD|BPF_B|BPF_ABS:
196 k = fentry->k; 196 k = fentry->k;
197load_b: 197load_b:
@@ -200,7 +200,7 @@ load_b:
200 A = *(u8 *)ptr; 200 A = *(u8 *)ptr;
201 continue; 201 continue;
202 } 202 }
203 return 0; 203 break;
204 case BPF_LD|BPF_W|BPF_LEN: 204 case BPF_LD|BPF_W|BPF_LEN:
205 A = skb->len; 205 A = skb->len;
206 continue; 206 continue;