/[linux-patches]/genpatches-2.6/tags/2.6.13-4/1002_1_fix-socket-filter-regression.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.13-4/1002_1_fix-socket-filter-regression.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 168 - (show annotations) (download)
Sun Sep 18 11:19:29 2005 UTC (10 years, 10 months ago) by dsd
File size: 1857 byte(s)
2.6.13-4 release
1 From stable-bounces@linux.kernel.org Mon Sep 5 18:47:45 2005
2 Date: Mon, 05 Sep 2005 18:47:10 -0700 (PDT)
3 To: stable@kernel.org
4 From: "David S. Miller" <davem@davemloft.net>
5 Cc: herbert@gondor.apana.org.au, kaber@trash.net
6 Subject: [NET]: 2.6.13 breaks libpcap (and tcpdump)
7
8 From: Herbert Xu <herbert@gondor.apana.org.au>
9
10 [NET]: 2.6.13 breaks libpcap (and tcpdump)
11
12 Patrick McHardy says:
13
14 Never mind, I got it, we never fall through to the second switch
15 statement anymore. I think we could simply break when load_pointer
16 returns NULL. The switch statement will fall through to the default
17 case and return 0 for all cases but 0 > k >= SKF_AD_OFF.
18
19 Here's a patch to do just that.
20
21 I left BPF_MSH alone because it's really a hack to calculate the IP
22 header length, which makes no sense when applied to the special data.
23
24 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
25 Signed-off-by: David S. Miller <davem@davemloft.net>
26 Signed-off-by: Chris Wright <chrisw@osdl.org>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
28 ---
29 net/core/filter.c | 6 +++---
30 1 files changed, 3 insertions(+), 3 deletions(-)
31
32 Index: linux-2.6.13.y/net/core/filter.c
33 ===================================================================
34 --- linux-2.6.13.y.orig/net/core/filter.c
35 +++ linux-2.6.13.y/net/core/filter.c
36 @@ -182,7 +182,7 @@ int sk_run_filter(struct sk_buff *skb, s
37 A = ntohl(*(u32 *)ptr);
38 continue;
39 }
40 - return 0;
41 + break;
42 case BPF_LD|BPF_H|BPF_ABS:
43 k = fentry->k;
44 load_h:
45 @@ -191,7 +191,7 @@ int sk_run_filter(struct sk_buff *skb, s
46 A = ntohs(*(u16 *)ptr);
47 continue;
48 }
49 - return 0;
50 + break;
51 case BPF_LD|BPF_B|BPF_ABS:
52 k = fentry->k;
53 load_b:
54 @@ -200,7 +200,7 @@ load_b:
55 A = *(u8 *)ptr;
56 continue;
57 }
58 - return 0;
59 + break;
60 case BPF_LD|BPF_W|BPF_LEN:
61 A = skb->len;
62 continue;

  ViewVC Help
Powered by ViewVC 1.1.20