tree 45f44e770c3102f0dcfdcb5de3709113e4e120db
parent 0b05b2a49e430220876f8faa7e4778dc7497033c
author Patrick McHardy <[EMAIL PROTECTED]> Wed, 06 Jul 2005 04:10:40 -0700
committer David S. Miller <[EMAIL PROTECTED]> Wed, 06 Jul 2005 04:10:40 -0700

[NET]: net/core/filter.c: make len cover the entire packet

As suggested by Herbert Xu:

Since we don't require anything to be in the linear packet range
anymore make len cover the entire packet.

Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>

 net/core/filter.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/core/filter.c b/net/core/filter.c
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -76,10 +76,6 @@ static inline void *load_pointer(struct 
  
 int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
 {
-       /* len is UNSIGNED. Byte wide insns relies only on implicit
-          type casts to prevent reading arbitrary memory locations.
-        */
-       unsigned int len = skb->len-skb->data_len;
        struct sock_filter *fentry;     /* We walk down these */
        void *ptr;
        u32 A = 0;                      /* Accumulator */
@@ -206,10 +202,10 @@ load_b:
                        }
                        return 0;
                case BPF_LD|BPF_W|BPF_LEN:
-                       A = len;
+                       A = skb->len;
                        continue;
                case BPF_LDX|BPF_W|BPF_LEN:
-                       X = len;
+                       X = skb->len;
                        continue;
                case BPF_LD|BPF_W|BPF_IND:
                        k = X + fentry->k;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to