Commit 36704413 authored by Florian Westphal's avatar Florian Westphal Committed by David S. Miller

mptcp: setsockopt: add SO_MARK support

Value is synced to all subflows.
Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 268b1238
...@@ -95,6 +95,12 @@ static void mptcp_sol_socket_sync_intval(struct mptcp_sock *msk, int optname, in ...@@ -95,6 +95,12 @@ static void mptcp_sol_socket_sync_intval(struct mptcp_sock *msk, int optname, in
ssk->sk_userlocks |= SOCK_RCVBUF_LOCK; ssk->sk_userlocks |= SOCK_RCVBUF_LOCK;
WRITE_ONCE(ssk->sk_rcvbuf, sk->sk_rcvbuf); WRITE_ONCE(ssk->sk_rcvbuf, sk->sk_rcvbuf);
break; break;
case SO_MARK:
if (READ_ONCE(ssk->sk_mark) != sk->sk_mark) {
ssk->sk_mark = sk->sk_mark;
sk_dst_reset(ssk);
}
break;
} }
subflow->setsockopt_seq = msk->setsockopt_seq; subflow->setsockopt_seq = msk->setsockopt_seq;
...@@ -132,6 +138,7 @@ static int mptcp_setsockopt_sol_socket_int(struct mptcp_sock *msk, int optname, ...@@ -132,6 +138,7 @@ static int mptcp_setsockopt_sol_socket_int(struct mptcp_sock *msk, int optname,
case SO_KEEPALIVE: case SO_KEEPALIVE:
mptcp_sol_socket_sync_intval(msk, optname, val); mptcp_sol_socket_sync_intval(msk, optname, val);
return 0; return 0;
case SO_MARK:
case SO_PRIORITY: case SO_PRIORITY:
case SO_SNDBUF: case SO_SNDBUF:
case SO_SNDBUFFORCE: case SO_SNDBUFFORCE:
...@@ -222,6 +229,7 @@ static int mptcp_setsockopt_sol_socket(struct mptcp_sock *msk, int optname, ...@@ -222,6 +229,7 @@ static int mptcp_setsockopt_sol_socket(struct mptcp_sock *msk, int optname,
case SO_SNDBUFFORCE: case SO_SNDBUFFORCE:
case SO_RCVBUF: case SO_RCVBUF:
case SO_RCVBUFFORCE: case SO_RCVBUFFORCE:
case SO_MARK:
return mptcp_setsockopt_sol_socket_int(msk, optname, optval, optlen); return mptcp_setsockopt_sol_socket_int(msk, optname, optval, optlen);
case SO_LINGER: case SO_LINGER:
return mptcp_setsockopt_sol_socket_linger(msk, optval, optlen); return mptcp_setsockopt_sol_socket_linger(msk, optval, optlen);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment