summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorShreyas Siravara <sshreyas@fb.com>2016-03-15 19:18:35 -0700
committerVijay Bellur <vbellur@redhat.com>2016-12-16 12:30:05 -0800
commit136e6c81201daeb49e5ca9b893ae23b3ba5c0bdc (patch)
treeda4297df1448b328564f0395d5dc9137c5ea1524 /rpc
parente9d8525a0d34130ba2a582109937b8e79eecf6ab (diff)
socket: Keepalives should happen on IPv6 as well as IPv4
Summary: - Check for AF_INET *and* AF_INET6. - This is a cherry-pick of D3057373 to 3.8 Signed-off-by: Shreyas Siravara <sshreyas@fb.com> Change-Id: I53eb79284eddfee6e13821c6570809f575b96769 BUG: 1405478 Reviewed-on: http://review.gluster.org/16167 Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Tested-by: Jeff Darcy <jdarcy@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-transport/socket/src/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index 35b1455f370..36388548937 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -864,7 +864,7 @@ __socket_keepalive (int fd, int family, int keepalive_intvl,
goto err;
}
#else
- if (family != AF_INET)
+ if (family != AF_INET && family != AF_INET6)
goto done;
ret = setsockopt (fd, IPPROTO_TCP, TCP_KEEPIDLE, &keepalive_idle,