use IPPROTO_TCP instead of SOL_TCP, for BSD compatibility (SOL_TCP == IPPROTO_TCP on linux)
This commit is contained in:
committed by
Nils O. Selåsdal
parent
1d709faf20
commit
c46099c64e
+3
-3
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user