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
committed by Nils O. Selåsdal
parent 1d709faf20
commit c46099c64e
+3 -3
View File
@@ -52,17 +52,17 @@ int uc_set_tcp_keepalive_cfg(int sockfd, const struct UCKeepConfig *cfg)
} }
//set the keepalive options //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) { if (rc != 0) {
return rc; 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) { if (rc != 0) {
return rc; 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) { if (rc != 0) {
return rc; return rc;
} }