aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Oester <kernel@linuxace.com>2006-06-26 00:00:57 -0700
committerDavid S. Miller <davem@davemloft.net>2006-06-26 00:00:57 -0700
commitf72b948dcbb8558d639214536c2ace1b0760f41d (patch)
tree5ff1c481585ed41fefc9f9b5a0a40991dc6ea30b
parent6048126440dcb3ba01316f961465c0ff5a255dd1 (diff)
[NET]: skb_find_text ignores to argument
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> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/skbuff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 8e5044ba3ab..6edbb90cbce 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1739,12 +1739,15 @@ unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
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);
}
/**