aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/dev.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index f1249472e90e..763a0eda7158 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3491,14 +3491,20 @@ static inline gro_result_t
3491__napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) 3491__napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
3492{ 3492{
3493 struct sk_buff *p; 3493 struct sk_buff *p;
3494 unsigned int maclen = skb->dev->hard_header_len;
3494 3495
3495 for (p = napi->gro_list; p; p = p->next) { 3496 for (p = napi->gro_list; p; p = p->next) {
3496 unsigned long diffs; 3497 unsigned long diffs;
3497 3498
3498 diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev; 3499 diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
3499 diffs |= p->vlan_tci ^ skb->vlan_tci; 3500 diffs |= p->vlan_tci ^ skb->vlan_tci;
3500 diffs |= compare_ether_header(skb_mac_header(p), 3501 if (maclen == ETH_HLEN)
3501 skb_gro_mac_header(skb)); 3502 diffs |= compare_ether_header(skb_mac_header(p),
3503 skb_gro_mac_header(skb));
3504 else if (!diffs)
3505 diffs = memcmp(skb_mac_header(p),
3506 skb_gro_mac_header(skb),
3507 maclen);
3502 NAPI_GRO_CB(p)->same_flow = !diffs; 3508 NAPI_GRO_CB(p)->same_flow = !diffs;
3503 NAPI_GRO_CB(p)->flush = 0; 3509 NAPI_GRO_CB(p)->flush = 0;
3504 } 3510 }