Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 0c42f7b

Browse files
committed
When you SO_MARK a socket to get it to use a different routing table, it doesn't currently reset the dst so until something else triggers that dst reset the new routing table is not used for the connection, this will force a route lookup next time you try to send something
1 parent 0f02bdb commit 0c42f7b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: net/core/sock.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,10 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
918918
case SO_MARK:
919919
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
920920
ret = -EPERM;
921-
else
921+
else {
922922
sk->sk_mark = val;
923+
sk_dst_reset(sk);
924+
}
923925
break;
924926

925927
/* We implement the SO_SNDLOWAT etc to

0 commit comments

Comments
 (0)