]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Add fix for libpcap and tcmpdump breakage from Herbert, fwd from DaveM.
authorChris Wright <chrisw@osdl.org>
Tue, 6 Sep 2005 02:04:24 +0000 (19:04 -0700)
committerChris Wright <chrisw@osdl.org>
Tue, 6 Sep 2005 02:04:24 +0000 (19:04 -0700)
queue/fix-socket-filter-regression.patch [new file with mode: 0644]
queue/series

diff --git a/queue/fix-socket-filter-regression.patch b/queue/fix-socket-filter-regression.patch
new file mode 100644 (file)
index 0000000..95b225e
--- /dev/null
@@ -0,0 +1,61 @@
+From stable-bounces@linux.kernel.org  Mon Sep  5 18:47:45 2005
+Date: Mon, 05 Sep 2005 18:47:10 -0700 (PDT)
+To: stable@kernel.org
+From: "David S. Miller" <davem@davemloft.net>
+Cc: herbert@gondor.apana.org.au, kaber@trash.net
+Subject: [NET]: 2.6.13 breaks libpcap (and tcpdump)
+
+From: Herbert Xu <herbert@gondor.apana.org.au>
+
+[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>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+ net/core/filter.c |    6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+Index: linux-2.6.13.y/net/core/filter.c
+===================================================================
+--- linux-2.6.13.y.orig/net/core/filter.c
++++ linux-2.6.13.y/net/core/filter.c
+@@ -182,7 +182,7 @@ int sk_run_filter(struct sk_buff *skb, s
+                               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, s
+                               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;
index 6856e9b684288298029cda4c01828eef3d3ad948..8624c9144973272c5f2251dc9becd08623a503ca 100644 (file)
@@ -3,3 +3,4 @@ aacraid-bad-BUG_ON-fix.patch
 fix-sk_forward_alloc-underflow-in-tcp_sendmsg.patch
 fix-pci-rom-mapping.patch
 pci_assign_unassigned_resources-update.patch
+fix-socket-filter-regression.patch