diff options
author | Alexander Aring <aahringo@redhat.com> | 2020-06-26 20:26:48 +0300 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2020-08-06 18:30:50 +0300 |
commit | 84d1c617402e7e67fc95ab2384da8dae7d1b0efe (patch) | |
tree | 34727011f296c2bca6274c00519c85e56e32e422 /net/core/sock.c | |
parent | 0ffddafc3a3970ef7013696e7f36b3d378bc4c16 (diff) | |
download | linux-84d1c617402e7e67fc95ab2384da8dae7d1b0efe.tar.xz |
net: sock: add sock_set_mark
This patch adds a new socket helper function to set the mark value for a
kernel socket.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 6c4acf1f0220..ea6e8348b3dc 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -828,6 +828,14 @@ void sock_set_rcvbuf(struct sock *sk, int val) } EXPORT_SYMBOL(sock_set_rcvbuf); +void sock_set_mark(struct sock *sk, u32 val) +{ + lock_sock(sk); + sk->sk_mark = val; + release_sock(sk); +} +EXPORT_SYMBOL(sock_set_mark); + /* * This is meant for all protocols to use and covers goings on * at the socket level. Everything here is generic. |