* [PATCH net] net: ipv4: Set addr_type in hash_keys for forwarded case
@ 2018-02-21 19:00 David Ahern
2018-02-21 19:15 ` Nikolay Aleksandrov
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: David Ahern @ 2018-02-21 19:00 UTC (permalink / raw)
To: netdev; +Cc: idosch, davem, nikolay, David Ahern
The result of the skb flow dissect is copied from keys to hash_keys to
ensure only the intended data is hashed. The original L4 hash patch
overlooked setting the addr_type for this case; add it.
Fixes: bf4e0a3db97eb ("net: ipv4: add support for ECMP hash policy choice")
Reported-by: Ido Schimmel <idosch@idosch.org>
Signed-off-by: David Ahern <dsahern@gmail.com>
---
net/ipv4/route.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 49cc1c1df1ba..a4f44d815a61 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1826,6 +1826,8 @@ int fib_multipath_hash(const struct fib_info *fi, const struct flowi4 *fl4,
return skb_get_hash_raw(skb) >> 1;
memset(&hash_keys, 0, sizeof(hash_keys));
skb_flow_dissect_flow_keys(skb, &keys, flag);
+
+ hash_keys.control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
hash_keys.addrs.v4addrs.src = keys.addrs.v4addrs.src;
hash_keys.addrs.v4addrs.dst = keys.addrs.v4addrs.dst;
hash_keys.ports.src = keys.ports.src;
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: ipv4: Set addr_type in hash_keys for forwarded case
2018-02-21 19:00 [PATCH net] net: ipv4: Set addr_type in hash_keys for forwarded case David Ahern
@ 2018-02-21 19:15 ` Nikolay Aleksandrov
2018-02-21 19:26 ` Ido Schimmel
2018-02-22 19:31 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Nikolay Aleksandrov @ 2018-02-21 19:15 UTC (permalink / raw)
To: David Ahern, netdev; +Cc: idosch, davem
On 21/02/18 21:00, David Ahern wrote:
> The result of the skb flow dissect is copied from keys to hash_keys to
> ensure only the intended data is hashed. The original L4 hash patch
> overlooked setting the addr_type for this case; add it.
>
> Fixes: bf4e0a3db97eb ("net: ipv4: add support for ECMP hash policy choice")
> Reported-by: Ido Schimmel <idosch@idosch.org>
> Signed-off-by: David Ahern <dsahern@gmail.com>
> ---
> net/ipv4/route.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 49cc1c1df1ba..a4f44d815a61 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -1826,6 +1826,8 @@ int fib_multipath_hash(const struct fib_info *fi, const struct flowi4 *fl4,
> return skb_get_hash_raw(skb) >> 1;
> memset(&hash_keys, 0, sizeof(hash_keys));
> skb_flow_dissect_flow_keys(skb, &keys, flag);
> +
> + hash_keys.control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
> hash_keys.addrs.v4addrs.src = keys.addrs.v4addrs.src;
> hash_keys.addrs.v4addrs.dst = keys.addrs.v4addrs.dst;
> hash_keys.ports.src = keys.ports.src;
>
Good catch,
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: ipv4: Set addr_type in hash_keys for forwarded case
2018-02-21 19:00 [PATCH net] net: ipv4: Set addr_type in hash_keys for forwarded case David Ahern
2018-02-21 19:15 ` Nikolay Aleksandrov
@ 2018-02-21 19:26 ` Ido Schimmel
2018-02-22 19:31 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2018-02-21 19:26 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, davem, nikolay
On Wed, Feb 21, 2018 at 11:00:54AM -0800, David Ahern wrote:
> The result of the skb flow dissect is copied from keys to hash_keys to
> ensure only the intended data is hashed. The original L4 hash patch
> overlooked setting the addr_type for this case; add it.
>
> Fixes: bf4e0a3db97eb ("net: ipv4: add support for ECMP hash policy choice")
> Reported-by: Ido Schimmel <idosch@idosch.org>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net: ipv4: Set addr_type in hash_keys for forwarded case
2018-02-21 19:00 [PATCH net] net: ipv4: Set addr_type in hash_keys for forwarded case David Ahern
2018-02-21 19:15 ` Nikolay Aleksandrov
2018-02-21 19:26 ` Ido Schimmel
@ 2018-02-22 19:31 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-02-22 19:31 UTC (permalink / raw)
To: dsahern; +Cc: netdev, idosch, nikolay
From: David Ahern <dsahern@gmail.com>
Date: Wed, 21 Feb 2018 11:00:54 -0800
> The result of the skb flow dissect is copied from keys to hash_keys to
> ensure only the intended data is hashed. The original L4 hash patch
> overlooked setting the addr_type for this case; add it.
>
> Fixes: bf4e0a3db97eb ("net: ipv4: add support for ECMP hash policy choice")
> Reported-by: Ido Schimmel <idosch@idosch.org>
> Signed-off-by: David Ahern <dsahern@gmail.com>
Applied and queued up for -stable, thanks David!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-02-22 19:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-21 19:00 [PATCH net] net: ipv4: Set addr_type in hash_keys for forwarded case David Ahern
2018-02-21 19:15 ` Nikolay Aleksandrov
2018-02-21 19:26 ` Ido Schimmel
2018-02-22 19:31 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).