Skip to content

Commit

Permalink
gro: Check for GSO packets and packets with frag_list
Browse files Browse the repository at this point in the history
As GRO cannot be applied to packets with frag_list we need to
make sure that we reject such packets if they are fed to us,
e.g., through a tunnel device.

Also there is no point in applying GRO on GSO packets so they
too should be rejected.  This allows GRO to be used in virtio-net
which may produce GSO packets directly but may still benefit
from GRO if the other end of it doesn't support GSO.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jan 14, 2009
1 parent 483a2b3 commit f17f5c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2392,6 +2392,9 @@ int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
if (!(skb->dev->features & NETIF_F_GRO))
goto normal;

if (skb_is_gso(skb) || skb_shinfo(skb)->frag_list)
goto normal;

rcu_read_lock();
list_for_each_entry_rcu(ptype, head, list) {
struct sk_buff *p;
Expand Down

0 comments on commit f17f5c9

Please sign in to comment.