Commit 15b84815 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune Committed by Martin Blix Grydeland

vca: Remove the tcp_opt::iponly field

It is a 1:1 mapping with IPPROTO_TCP, so TCP_NODELAY was moved down to
be with the other IPPROTO_TCP options.
parent a475d980
...@@ -88,20 +88,20 @@ static struct tcp_opt { ...@@ -88,20 +88,20 @@ static struct tcp_opt {
socklen_t sz; socklen_t sz;
void *ptr; void *ptr;
int need; int need;
int iponly;
} tcp_opts[] = { } tcp_opts[] = {
#define TCPO(lvl, nam, sz, ip) { lvl, nam, #nam, sizeof(sz), 0, 0, ip}, #define TCPO(lvl, nam, typ) { lvl, nam, #nam, sizeof(typ), NULL, 0 },
TCPO(SOL_SOCKET, SO_LINGER, struct linger, 0) TCPO(SOL_SOCKET, SO_LINGER, struct linger)
TCPO(SOL_SOCKET, SO_KEEPALIVE, int, 0) TCPO(SOL_SOCKET, SO_KEEPALIVE, int)
TCPO(IPPROTO_TCP, TCP_NODELAY, int, 1) TCPO(SOL_SOCKET, SO_SNDTIMEO, struct timeval)
TCPO(SOL_SOCKET, SO_SNDTIMEO, struct timeval, 0) TCPO(SOL_SOCKET, SO_RCVTIMEO, struct timeval)
TCPO(SOL_SOCKET, SO_RCVTIMEO, struct timeval, 0)
TCPO(IPPROTO_TCP, TCP_NODELAY, int)
#ifdef HAVE_TCP_KEEP #ifdef HAVE_TCP_KEEP
TCPO(IPPROTO_TCP, TCP_KEEPIDLE, int, 1) TCPO(IPPROTO_TCP, TCP_KEEPIDLE, int)
TCPO(IPPROTO_TCP, TCP_KEEPCNT, int, 1) TCPO(IPPROTO_TCP, TCP_KEEPCNT, int)
TCPO(IPPROTO_TCP, TCP_KEEPINTVL, int, 1) TCPO(IPPROTO_TCP, TCP_KEEPINTVL, int)
#endif #endif
#undef TCPO #undef TCPO
...@@ -220,7 +220,7 @@ vca_tcp_opt_test(const int sock, const unsigned uds) ...@@ -220,7 +220,7 @@ vca_tcp_opt_test(const int sock, const unsigned uds)
for (n = 0; n < n_tcp_opts; n++) { for (n = 0; n < n_tcp_opts; n++) {
to = &tcp_opts[n]; to = &tcp_opts[n];
if (to->iponly && uds) if (to->level == IPPROTO_TCP && uds)
continue; continue;
to->need = 1; to->need = 1;
ptr = calloc(1, to->sz); ptr = calloc(1, to->sz);
...@@ -243,7 +243,7 @@ vca_tcp_opt_set(const int sock, const unsigned uds, const int force) ...@@ -243,7 +243,7 @@ vca_tcp_opt_set(const int sock, const unsigned uds, const int force)
for (n = 0; n < n_tcp_opts; n++) { for (n = 0; n < n_tcp_opts; n++) {
to = &tcp_opts[n]; to = &tcp_opts[n];
if (to->iponly && uds) if (to->level == IPPROTO_TCP && uds)
continue; continue;
if (to->need || force) { if (to->need || force) {
VTCP_Assert(setsockopt(sock, VTCP_Assert(setsockopt(sock,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment