|
Line
Link Here
|
|
[PATCH] 2.6.13 breaks libpcap (and tcpdump) |
|
[PATCH] 2.6.13 breaks libpcap (and tcpdump) |
| 1 |
|
1 |
|
| 2 |
[NET]: 2.6.13 breaks libpcap (and tcpdump) |
2 |
[NET]: 2.6.13 breaks libpcap (and tcpdump) |
| 3 |
|
3 |
|
| 4 |
Patrick McHardy says: |
4 |
Patrick McHardy says: |
| 5 |
|
5 |
|
| 6 |
Never mind, I got it, we never fall through to the second switch |
6 |
Never mind, I got it, we never fall through to the second switch |
| 7 |
statement anymore. I think we could simply break when load_pointer |
7 |
statement anymore. I think we could simply break when load_pointer |
| 8 |
returns NULL. The switch statement will fall through to the default |
8 |
returns NULL. The switch statement will fall through to the default |
| 9 |
case and return 0 for all cases but 0 > k >= SKF_AD_OFF. |
9 |
case and return 0 for all cases but 0 > k >= SKF_AD_OFF. |
| 10 |
|
10 |
|
| 11 |
Here's a patch to do just that. |
11 |
Here's a patch to do just that. |
| 12 |
|
12 |
|
| 13 |
I left BPF_MSH alone because it's really a hack to calculate the IP |
13 |
I left BPF_MSH alone because it's really a hack to calculate the IP |
| 14 |
header length, which makes no sense when applied to the special data. |
14 |
header length, which makes no sense when applied to the special data. |
| 15 |
|
15 |
|
| 16 |
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> |
16 |
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> |
| 17 |
Signed-off-by: David S. Miller <davem@davemloft.net> |
17 |
Signed-off-by: David S. Miller <davem@davemloft.net> |
| 18 |
Signed-off-by: Chris Wright <chrisw@osdl.org> |
18 |
Signed-off-by: Chris Wright <chrisw@osdl.org> |
| 19 |
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> |
19 |
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> |
| 20 |
-- |
20 |
++ b/net/core/filter.c |
| 21 |
-- a/net/core/filter.c |
|
|
|
Lines 182-188
int sk_run_filter(struct sk_buff *skb, s
Link Here
|
| 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: |
|
Lines 191-197
int sk_run_filter(struct sk_buff *skb, s
Link Here
|
| 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; |
| 197 |
load_b: |
197 |
load_b: |
|
Lines 200-206
load_b:
Link Here
|
| 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; |