diff mbox

[net-next,4/4] net: Don't clear skbuff hash for IP fragments

Message ID alpine.DEB.2.02.1403201702170.7148@tomh.mtv.corp.google.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Tom Herbert March 21, 2014, 12:09 a.m. UTC
There is nothing to gain by clearing hash, it shouldn't be an L4
hash anyway.

Signed-off-by: Tom Herbert <therbert@google.com>
---
 net/ipv4/ip_fragment.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Eric Dumazet March 21, 2014, 1:47 a.m. UTC | #1
On Thu, 2014-03-20 at 17:09 -0700, Tom Herbert wrote:
> There is nothing to gain by clearing hash, it shouldn't be an L4
> hash anyway.
> 
> Signed-off-by: Tom Herbert <therbert@google.com>
> ---
>  net/ipv4/ip_fragment.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
> index c10a3ce..10a64de 100644
> --- a/net/ipv4/ip_fragment.c
> +++ b/net/ipv4/ip_fragment.c
> @@ -704,7 +704,6 @@ struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user)
>  			memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
>  			if (ip_defrag(skb, user))
>  				return NULL;
> -			skb_clear_hash(skb);
>  		}
>  	}
>  	return skb;

It might be worth checking ip_defrag() will set skb->hash to the hash
provided in the first fragment, the one that might give l4 info...



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tom Herbert March 21, 2014, 10:41 p.m. UTC | #2
On Thu, Mar 20, 2014 at 6:47 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Thu, 2014-03-20 at 17:09 -0700, Tom Herbert wrote:
>> There is nothing to gain by clearing hash, it shouldn't be an L4
>> hash anyway.
>>
>> Signed-off-by: Tom Herbert <therbert@google.com>
>> ---
>>  net/ipv4/ip_fragment.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
>> index c10a3ce..10a64de 100644
>> --- a/net/ipv4/ip_fragment.c
>> +++ b/net/ipv4/ip_fragment.c
>> @@ -704,7 +704,6 @@ struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user)
>>                       memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
>>                       if (ip_defrag(skb, user))
>>                               return NULL;
>> -                     skb_clear_hash(skb);
>>               }
>>       }
>>       return skb;
>
> It might be worth checking ip_defrag() will set skb->hash to the hash
> provided in the first fragment, the one that might give l4 info...
>
I believe we're already getting this, the head fragment which might
contain the l4_hash is being cloned into the skb for processing packet
in the stack.

>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index c10a3ce..10a64de 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -704,7 +704,6 @@  struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user)
 			memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
 			if (ip_defrag(skb, user))
 				return NULL;
-			skb_clear_hash(skb);
 		}
 	}
 	return skb;