Commit 5dd5ad68 authored by Chuck Lever's avatar Chuck Lever Committed by Jakub Kicinski

SUNRPC: Send TLS Closure alerts before closing a TCP socket

Before closing a TCP connection, the TLS protocol wants peers to
send session close Alert notifications. Add those in both the RPC
client and server.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Link: https://lore.kernel.org/r/169047939404.5241.14392506226409865832.stgit@oracle-102.nfsv4bat.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 35b1b538
...@@ -1622,6 +1622,8 @@ static void svc_tcp_sock_detach(struct svc_xprt *xprt) ...@@ -1622,6 +1622,8 @@ static void svc_tcp_sock_detach(struct svc_xprt *xprt)
{ {
struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt); struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt);
tls_handshake_close(svsk->sk_sock);
svc_sock_detach(xprt); svc_sock_detach(xprt);
if (!test_bit(XPT_LISTENER, &xprt->xpt_flags)) { if (!test_bit(XPT_LISTENER, &xprt->xpt_flags)) {
......
...@@ -1293,6 +1293,8 @@ static void xs_close(struct rpc_xprt *xprt) ...@@ -1293,6 +1293,8 @@ static void xs_close(struct rpc_xprt *xprt)
dprintk("RPC: xs_close xprt %p\n", xprt); dprintk("RPC: xs_close xprt %p\n", xprt);
if (transport->sock)
tls_handshake_close(transport->sock);
xs_reset_transport(transport); xs_reset_transport(transport);
xprt->reestablish_timeout = 0; xprt->reestablish_timeout = 0;
} }
......
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