diff options
author | Thomas Chenault <thomas_chenault@dell.com> | 2009-05-19 00:43:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-19 00:43:27 -0400 |
commit | 995b337952cdf7e05d288eede580257b632a8343 (patch) | |
tree | 478904bce184ab3e600d80c5ea6835f173bad932 /net | |
parent | 511e11e396dc596825ce04d53d7f6d579404bc01 (diff) |
net: fix skb_seq_read returning wrong offset/length for page frag data
When called with a consumed value that is less than skb_headlen(skb)
bytes into a page frag, skb_seq_read() incorrectly returns an
offset/length relative to skb->data. Ensure that data which should come
from a page frag does.
Signed-off-by: Thomas Chenault <thomas_chenault@dell.com>
Tested-by: Shyam Iyer <shyam_iyer@dell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/skbuff.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index d152394b2611..e505b5392e1e 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2288,7 +2288,7 @@ unsigned int skb_seq_read(unsigned int consumed, const u8 **data, | |||
2288 | next_skb: | 2288 | next_skb: |
2289 | block_limit = skb_headlen(st->cur_skb) + st->stepped_offset; | 2289 | block_limit = skb_headlen(st->cur_skb) + st->stepped_offset; |
2290 | 2290 | ||
2291 | if (abs_offset < block_limit) { | 2291 | if (abs_offset < block_limit && !st->frag_data) { |
2292 | *data = st->cur_skb->data + (abs_offset - st->stepped_offset); | 2292 | *data = st->cur_skb->data + (abs_offset - st->stepped_offset); |
2293 | return block_limit - abs_offset; | 2293 | return block_limit - abs_offset; |
2294 | } | 2294 | } |