Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133956
b: refs/heads/master
c: ad0f990
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Feb 1, 2009
1 parent fa6bfa5 commit cfc420b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 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: 3efac5a0012979ae236fe1247b773317ef5f1c88
refs/heads/master: ad0f9904444de1309dedd2b9e365cae8af77d9b1
16 changes: 10 additions & 6 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static inline struct hlist_head *dev_index_hash(struct net *net, int ifindex)

static inline void *skb_gro_mac_header(struct sk_buff *skb)
{
return skb_headlen(skb) ? skb_mac_header(skb) :
return skb_mac_header(skb) < skb->data ? skb_mac_header(skb) :
page_address(skb_shinfo(skb)->frags[0].page) +
skb_shinfo(skb)->frags[0].page_offset;
}
Expand Down Expand Up @@ -2469,11 +2469,19 @@ int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
napi->gro_list = skb;
ret = GRO_HELD;

pull:
if (unlikely(!pskb_may_pull(skb, skb_gro_offset(skb)))) {
if (napi->gro_list == skb)
napi->gro_list = skb->next;
ret = GRO_DROP;
}

ok:
return ret;

normal:
return GRO_NORMAL;
ret = GRO_NORMAL;
goto pull;
}
EXPORT_SYMBOL(dev_gro_receive);

Expand Down Expand Up @@ -2589,14 +2597,10 @@ EXPORT_SYMBOL(napi_fraginfo_skb);
int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb, int ret)
{
int err = NET_RX_SUCCESS;
int may;

switch (ret) {
case GRO_NORMAL:
case GRO_HELD:
may = pskb_may_pull(skb, skb_gro_offset(skb));
BUG_ON(!may);

skb->protocol = eth_type_trans(skb, napi->dev);

if (ret == GRO_NORMAL)
Expand Down

0 comments on commit cfc420b

Please sign in to comment.