netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Oester <kernel@linuxace.com>
To: netdev@vger.kernel.org
Subject: [PATCH] skb_find_text ignores to argument
Date: Sun, 25 Jun 2006 07:52:00 -0700	[thread overview]
Message-ID: <20060625145200.GA32074@linuxace.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

skb_find_text takes a "to" argument which is supposed to limit how
far into the skb it will search for the given text.  At present,
it seems to ignore that argument on the first skb, and instead
return a match even if the text occurs beyond the limit.

Patch below fixes this, after adjusting for the "from" starting
point.  This consequently fixes the netfilter string match's "--to"
handling, which currently is broken.

Phil

Signed-off-by: Phil Oester <kernel@linuxace.com>



[-- Attachment #2: patch-skbfindtext --]
[-- Type: text/plain, Size: 616 bytes --]

diff -ruN linux-orig/net/core/skbuff.c linux-new/net/core/skbuff.c
--- linux-orig/net/core/skbuff.c	2006-06-25 01:26:02.000000000 -0400
+++ linux-new/net/core/skbuff.c	2006-06-25 01:29:40.000000000 -0400
@@ -1739,12 +1739,15 @@
 			   unsigned int to, struct ts_config *config,
 			   struct ts_state *state)
 {
+	unsigned int ret;
+
 	config->get_next_block = skb_ts_get_next_block;
 	config->finish = skb_ts_finish;
 
 	skb_prepare_seq_read(skb, from, to, TS_SKB_CB(state));
 
-	return textsearch_find(config, state);
+	ret = textsearch_find(config, state);
+	return (ret <= to - from ? ret : UINT_MAX);
 }
 
 /**

             reply	other threads:[~2006-06-25 14:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-25 14:52 Phil Oester [this message]
2006-06-26  7:01 ` [PATCH] skb_find_text ignores to argument David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060625145200.GA32074@linuxace.com \
    --to=kernel@linuxace.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).