Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98559
b: refs/heads/master
c: db43a28
h: refs/heads/master
i:
  98557: dd286b6
  98555: 218917f
  98551: bcf0aab
  98543: b49f52a
  98527: 9a912ba
  98495: 597b196
  98431: a3b24e6
  98303: 8d3fd52
v: v3
  • Loading branch information
Octavian Purdila authored and David S. Miller committed Jun 28, 2008
1 parent 321653e commit b15503f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57413ebc4e0f1e471a3b4db4aff9a85c083d090e
refs/heads/master: db43a282d3ec92ea45109c5551fff3dcc5afef02
17 changes: 12 additions & 5 deletions trunk/net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1292,12 +1292,14 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset,
{
unsigned int nr_pages = spd->nr_pages;
unsigned int poff, plen, len, toff, tlen;
int headlen, seg;
int headlen, seg, error = 0;

toff = *offset;
tlen = *total_len;
if (!tlen)
if (!tlen) {
error = 1;
goto err;
}

/*
* if the offset is greater than the linear part, go directly to
Expand Down Expand Up @@ -1339,7 +1341,8 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset,
* just jump directly to update and return, no point
* in going over fragments when the output is full.
*/
if (spd_fill_page(spd, virt_to_page(p), plen, poff, skb))
error = spd_fill_page(spd, virt_to_page(p), plen, poff, skb);
if (error)
goto done;

tlen -= plen;
Expand Down Expand Up @@ -1369,7 +1372,8 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset,
if (!plen)
break;

if (spd_fill_page(spd, f->page, plen, poff, skb))
error = spd_fill_page(spd, f->page, plen, poff, skb);
if (error)
break;

tlen -= plen;
Expand All @@ -1382,7 +1386,10 @@ static int __skb_splice_bits(struct sk_buff *skb, unsigned int *offset,
return 0;
}
err:
return 1;
/* update the offset to reflect the linear part skip, if any */
if (!error)
*offset = toff;
return error;
}

/*
Expand Down

0 comments on commit b15503f

Please sign in to comment.