diff options
author | Michal Kubecek <mkubecek@suse.cz> | 2018-06-02 09:40:34 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-04 13:18:35 -0400 |
commit | 87ae68c8b4944d142447b88875c9c412c714434f (patch) | |
tree | ed27f4796483c56b128a7c2f40d0b59540ffc6fe /include/net | |
parent | fe083b3f06e91cf8508f23922867e52348205825 (diff) | |
download | talos-obmc-linux-87ae68c8b4944d142447b88875c9c412c714434f.tar.gz talos-obmc-linux-87ae68c8b4944d142447b88875c9c412c714434f.zip |
ipv6: omit traffic class when calculating flow hash
Some of the code paths calculating flow hash for IPv6 use flowlabel member
of struct flowi6 which, despite its name, encodes both flow label and
traffic class. If traffic class changes within a TCP connection (as e.g.
ssh does), ECMP route can switch between path. It's also incosistent with
other code paths where ip6_flowlabel() (returning only flow label) is used
to feed the key.
Use only flow label everywhere, including one place where hash key is set
using ip6_flowinfo().
Fixes: 51ebd3181572 ("ipv6: add support of equal cost multipath (ECMP)")
Fixes: f70ea018da06 ("net: Add functions to get skb->hash based on flow structures")
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ipv6.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 798558fd1681..6dcc473fbe51 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -907,6 +907,11 @@ static inline __be32 ip6_make_flowinfo(unsigned int tclass, __be32 flowlabel) return htonl(tclass << IPV6_TCLASS_SHIFT) | flowlabel; } +static inline u32 flowi6_get_flowlabel(const struct flowi6 *fl6) +{ + return (__force u32)(fl6->flowlabel & IPV6_FLOWLABEL_MASK); +} + /* * Prototypes exported by ipv6 */ |