Add SO_KEEPALIVE to iprop clients (slaves)
This commit is contained in:

committed by
Viktor Dukhovni

parent
54d37fdba6
commit
8fe294d0d7
@@ -53,6 +53,7 @@ connect_to_master (krb5_context context, const char *master,
|
|||||||
struct addrinfo *ai, *a;
|
struct addrinfo *ai, *a;
|
||||||
struct addrinfo hints;
|
struct addrinfo hints;
|
||||||
int error;
|
int error;
|
||||||
|
int one = 1;
|
||||||
int s = -1;
|
int s = -1;
|
||||||
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
@@ -95,6 +96,9 @@ connect_to_master (krb5_context context, const char *master,
|
|||||||
if (a == NULL)
|
if (a == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &one, sizeof(one)) < 0)
|
||||||
|
krb5_warn(context, errno, "setsockopt(SO_KEEPALIVE) failed");
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user