Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vxlan: do not use RT_TOS for IPv6 flowlabel

According to Guillaume Nault RT_TOS should never be used for IPv6.

Quote:
RT_TOS() is an old macro used to interprete IPv4 TOS as described in
the obsolete RFC 1349. It's conceptually wrong to use it even in IPv4
code, although, given the current state of the code, most of the
existing calls have no consequence.

But using RT_TOS() in IPv6 code is always a bug: IPv6 never had a "TOS"
field to be interpreted the RFC 1349 way. There's no historical
compatibility to worry about.

Fixes: 1400615d64cf ("vxlan: allow setting ipv6 traffic class")
Acked-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: Matthias May <matthias.may@westermo.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Matthias May and committed by
Jakub Kicinski
e488d4f5 ca2bb695

+1 -1
+1 -1
drivers/net/vxlan/vxlan_core.c
··· 2321 2321 fl6.flowi6_oif = oif; 2322 2322 fl6.daddr = *daddr; 2323 2323 fl6.saddr = *saddr; 2324 - fl6.flowlabel = ip6_make_flowinfo(RT_TOS(tos), label); 2324 + fl6.flowlabel = ip6_make_flowinfo(tos, label); 2325 2325 fl6.flowi6_mark = skb->mark; 2326 2326 fl6.flowi6_proto = IPPROTO_UDP; 2327 2327 fl6.fl6_dport = dport;