diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2013-01-29 10:50:01 -0500 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-01-29 10:01:01 -0800 |
commit | fed0752313c37c500d3b88f0651c4923cec4cf9b (patch) | |
tree | 9b85c4e9c5e9cd4d910ee0f46cd7a1c4f631fc6a /rpc/rpc-transport/socket | |
parent | c3f1c0c18a04615cb33040748d1eae558a9203b5 (diff) |
socket: null out priv->ssl_ssl on disconnect
This prevents problems when a socket transport is reused for a non-SSL
connection (e.g. glusterd portmapper) after having been used for an SSL
connection (e.g. a brick). In that case, ssl_ssl will still be non-null from
the first connection, even though the structure it points to has actually been
freed.
I'm not sure why/how we would reuse a socket transport in this way (the case of
SSL after non-SSL has been common for a long time) but recent glusterd changes
seem to have had that effect.
Change-Id: I46f1ff3c409c122478bf720a7f02d92abcc32bed
BUG: 902684
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/4449
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'rpc/rpc-transport/socket')
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index 9494362bce3..7657e5d3562 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -605,6 +605,7 @@ __socket_disconnect (rpc_transport_t *this) SSL_shutdown(priv->ssl_ssl); SSL_clear(priv->ssl_ssl); SSL_free(priv->ssl_ssl); + priv->ssl_ssl = NULL; } if (priv->own_thread) { /* @@ -3241,6 +3242,7 @@ socket_init (rpc_transport_t *this) if (!priv) { return -1; } + memset(priv,0,sizeof(*priv)); pthread_mutex_init (&priv->lock, NULL); |