use IPPROTO_TCP instead of SOL_TCP, for BSD compatibility (SOL_TCP == IPPROTO_TCP on linux)

This commit is contained in:
Nils O. Selaasdal
2013-11-10 23:51:29 +01:00
parent 6b26812cf3
commit 11ac54ae6b
+3 -3
View File
@@ -52,17 +52,17 @@ int uc_set_tcp_keepalive_cfg(int sockfd, const struct UCKeepConfig *cfg)
}
//set the keepalive options
rc = setsockopt(sockfd, SOL_TCP, TCP_KEEPCNT, &cfg->keepcnt, sizeof cfg->keepcnt);
rc = setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT, &cfg->keepcnt, sizeof cfg->keepcnt);
if (rc != 0) {
return rc;
}
rc = setsockopt(sockfd, SOL_TCP, TCP_KEEPCNT, &cfg->keepidle, sizeof cfg->keepintvl);
rc = setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT, &cfg->keepidle, sizeof cfg->keepintvl);
if (rc != 0) {
return rc;
}
rc = setsockopt(sockfd, SOL_TCP, TCP_KEEPCNT, &cfg->keepintvl, sizeof cfg->keepintvl);
rc = setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPCNT, &cfg->keepintvl, sizeof cfg->keepintvl);
if (rc != 0) {
return rc;
}