Skip to content

Commit 42dcfd8

Browse files
kuba-moodavem330
authored andcommitted
udp6: allow SO_MARK ctrl msg to affect routing
Commit c6af0c2 ("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: c6af0c2 ("ip: support SO_MARK cmsg") Reported-and-tested-by: Xintong Hu <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: David Ahern <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6de6e46 commit 42dcfd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv6/udp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,6 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
14351435
if (!fl6.flowi6_oif)
14361436
fl6.flowi6_oif = np->sticky_pktinfo.ipi6_ifindex;
14371437

1438-
fl6.flowi6_mark = ipc6.sockc.mark;
14391438
fl6.flowi6_uid = sk->sk_uid;
14401439

14411440
if (msg->msg_controllen) {
@@ -1471,6 +1470,7 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
14711470
ipc6.opt = opt;
14721471

14731472
fl6.flowi6_proto = sk->sk_protocol;
1473+
fl6.flowi6_mark = ipc6.sockc.mark;
14741474
fl6.daddr = *daddr;
14751475
if (ipv6_addr_any(&fl6.saddr) && !ipv6_addr_any(&np->saddr))
14761476
fl6.saddr = np->saddr;

0 commit comments

Comments
 (0)