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

udp6: allow SO_MARK ctrl msg to affect routing

Commit c6af0c227a22 ("ip: support SO_MARK cmsg")
added propagation of SO_MARK from cmsg to skb->mark.
For IPv4 and raw sockets the mark also affects route
lookup, but in case of IPv6 the flow info is
initialized before cmsg is parsed.

Fixes: c6af0c227a22 ("ip: support SO_MARK cmsg")
Reported-and-tested-by: Xintong Hu <huxintong@fb.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jakub Kicinski and committed by
David S. Miller
42dcfd85 6de6e46d

+1 -1
+1 -1
net/ipv6/udp.c
··· 1435 1435 if (!fl6.flowi6_oif) 1436 1436 fl6.flowi6_oif = np->sticky_pktinfo.ipi6_ifindex; 1437 1437 1438 - fl6.flowi6_mark = ipc6.sockc.mark; 1439 1438 fl6.flowi6_uid = sk->sk_uid; 1440 1439 1441 1440 if (msg->msg_controllen) { ··· 1470 1471 ipc6.opt = opt; 1471 1472 1472 1473 fl6.flowi6_proto = sk->sk_protocol; 1474 + fl6.flowi6_mark = ipc6.sockc.mark; 1473 1475 fl6.daddr = *daddr; 1474 1476 if (ipv6_addr_any(&fl6.saddr) && !ipv6_addr_any(&np->saddr)) 1475 1477 fl6.saddr = np->saddr;