From a9d893255c78dcfe06463c1541267d2733f25e70 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sun, 8 Feb 2009 18:00:39 +0000 Subject: [PATCH] --- yaml --- r: 134355 b: refs/heads/master c: a5ad24be728d4352b71a81fba471aa41eb71f83a h: refs/heads/master i: 134353: c2fc2f598733182ca5d0a146a4dc7dc573f5c5c0 134351: bcda6acdebfe67e73ceaadc659635391ab3dfc58 v: v3 --- [refs] | 2 +- trunk/net/ipv4/af_inet.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index ac9ecb40b170..db8a745243ba 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: aa4b9f533ed5a22952e038b9fac2447ccc682124 +refs/heads/master: a5ad24be728d4352b71a81fba471aa41eb71f83a diff --git a/trunk/net/ipv4/af_inet.c b/trunk/net/ipv4/af_inet.c index c79087719df0..627be4dc7fb0 100644 --- a/trunk/net/ipv4/af_inet.c +++ b/trunk/net/ipv4/af_inet.c @@ -1263,7 +1263,7 @@ static struct sk_buff **inet_gro_receive(struct sk_buff **head, if (!ops || !ops->gro_receive) goto out_unlock; - if (iph->version != 4 || iph->ihl != 5) + if (*(u8 *)iph != 0x45) goto out_unlock; if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl))) @@ -1281,17 +1281,18 @@ static struct sk_buff **inet_gro_receive(struct sk_buff **head, iph2 = ip_hdr(p); - if (iph->protocol != iph2->protocol || - iph->tos != iph2->tos || - memcmp(&iph->saddr, &iph2->saddr, 8)) { + if ((iph->protocol ^ iph2->protocol) | + (iph->tos ^ iph2->tos) | + (iph->saddr ^ iph2->saddr) | + (iph->daddr ^ iph2->daddr)) { NAPI_GRO_CB(p)->same_flow = 0; continue; } /* All fields must match except length and checksum. */ NAPI_GRO_CB(p)->flush |= - memcmp(&iph->frag_off, &iph2->frag_off, 4) || - (u16)(ntohs(iph2->id) + NAPI_GRO_CB(p)->count) != id; + (iph->ttl ^ iph2->ttl) | + ((u16)(ntohs(iph2->id) + NAPI_GRO_CB(p)->count) ^ id); NAPI_GRO_CB(p)->flush |= flush; }