diff options
author | Alexander Aring <aahringo@redhat.com> | 2020-06-26 19:26:50 +0200 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2020-08-06 17:30:52 +0200 |
commit | 9c9f168f5b145986535f727d259ef75f6ea26990 (patch) | |
tree | e205fd0735aedc66ff81a585c79d216011da2e30 /fs/dlm/lowcomms.c | |
parent | fs: dlm: set skb mark for listen socket (diff) | |
download | linux-9c9f168f5b145986535f727d259ef75f6ea26990.tar.xz linux-9c9f168f5b145986535f727d259ef75f6ea26990.zip |
fs: dlm: set skb mark per peer socket
This patch adds support to set the skb mark value for the DLM tcp and
sctp socket per peer. The mark value will be offered as per comm value
of configfs. At creation time of the peer socket it will be set as
socket option.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | fs/dlm/lowcomms.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index eaedad7d069a..3fa1b93dbbc7 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -914,6 +914,7 @@ static void sctp_connect_to_sock(struct connection *con) int result; int addr_len; struct socket *sock; + unsigned int mark; if (con->nodeid == 0) { log_print("attempt to connect sock 0 foiled"); @@ -944,6 +945,13 @@ static void sctp_connect_to_sock(struct connection *con) if (result < 0) goto socket_err; + /* set skb mark */ + result = dlm_comm_mark(con->nodeid, &mark); + if (result < 0) + goto bind_err; + + sock_set_mark(sock->sk, mark); + con->rx_action = receive_from_sock; con->connect_action = sctp_connect_to_sock; add_sock(sock, con); @@ -1006,6 +1014,7 @@ static void tcp_connect_to_sock(struct connection *con) struct sockaddr_storage saddr, src_addr; int addr_len; struct socket *sock = NULL; + unsigned int mark; int result; if (con->nodeid == 0) { @@ -1027,6 +1036,13 @@ static void tcp_connect_to_sock(struct connection *con) if (result < 0) goto out_err; + /* set skb mark */ + result = dlm_comm_mark(con->nodeid, &mark); + if (result < 0) + goto out_err; + + sock_set_mark(sock->sk, mark); + memset(&saddr, 0, sizeof(saddr)); result = nodeid_to_addr(con->nodeid, &saddr, NULL, false); if (result < 0) { |