--- /dev/null
+ o Major bugfixes (Linux seccomp2 sandbox):
+ - Pass IPPROTO_TCP rather than 0 to socket(), so that the
+ Linux seccomp2 sandbox doesn't fail. Fixes bug 14989;
+ bugfix on 0.2.6.3-alpha.
tor_socket_t s;
int inprogress = 0;
const or_options_t *options = get_options();
- int protocol_family;
tor_assert(conn);
tor_assert(sa);
return -1;
}
- protocol_family = sa->sa_family;
-
if (get_options()->DisableNetwork) {
/* We should never even try to connect anyplace if DisableNetwork is set.
* Warn if we do, and refuse to make the connection. */
return -1;
}
- s = tor_open_socket_nonblocking(protocol_family, SOCK_STREAM, 0);
+ const int protocol_family = sa->sa_family;
+ const int proto = (sa->sa_family == AF_INET6 ||
+ sa->sa_family == AF_INET) ? IPPROTO_TCP : 0;
+
+ s = tor_open_socket_nonblocking(protocol_family, SOCK_STREAM, proto);
if (! SOCKET_OK(s)) {
*socket_error = tor_socket_errno(-1);
log_warn(LD_NET,"Error creating network socket: %s",