All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] skb_find_text ignores to argument
@ 2006-06-25 14:52 Phil Oester
  2006-06-26  7:01 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Oester @ 2006-06-25 14:52 UTC (permalink / raw)
  To: netdev

[-- 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);
 }
 
 /**

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] skb_find_text ignores to argument
  2006-06-25 14:52 [PATCH] skb_find_text ignores to argument Phil Oester
@ 2006-06-26  7:01 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2006-06-26  7:01 UTC (permalink / raw)
  To: kernel; +Cc: netdev

From: Phil Oester <kernel@linuxace.com>
Date: Sun, 25 Jun 2006 07:52:00 -0700

> 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.
> 
> Signed-off-by: Phil Oester <kernel@linuxace.com>

Looks good, applied.

Thanks Phil.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-26  7:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-25 14:52 [PATCH] skb_find_text ignores to argument Phil Oester
2006-06-26  7:01 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.