Open fcoquelet opened 1 year ago
@fcoquelet I guess this error is caused by the old kernel version or by the ARMv5 arch.
The error 38 shown in the log file is a system error defined in "errno.h" (of the build toolchain) as
#define ENOSYS 38 /* Function not implemented */
In the stunnel source code there are the following functions writing "FD=..."
logs in the loop reported by you:
void s_poll_dump(s_poll_set *fds, int level) {
unsigned i;
for(i=0; i<fds->nfds; i++)
s_log(level, "FD=%ld events=0x%X revents=0x%X",
(long)fds->ufds[i].fd, fds->ufds[i].events, fds->ufds[i].revents);
}
The error log is not so easy to locate in the source code.
There are generic logger funcions defined in log.c
void ioerror(const char *txt) { /* input/output error */
log_error(LOG_ERR, (int)get_last_error(), txt);
}
void sockerror(const char *txt) { /* socket error */
log_error(LOG_ERR, get_last_socket_error(), txt);
}
void log_error(int level, int error, const char *txt) { /* generic error */
s_log(level, "%s: %s (%d)", txt, s_strerror(error), error);
}
The error local socket: Function not implemented (38)
must occur when calling s=s_accept(fd, &addr.sa, &addrlen, 1, "local socket");
in stunnel.c
.
This is the only code with the text "local socket"
.
s_accept
is called in accept_connection
function within the daemon_loop
in stunnel.c
s_accept
is implemented in fd.c
(file descriptor functions) and is calling setup_fd
.
if setup_fd
is called with an invalid socket file descriptor, the error reported is logged with socketerror
and the message local socket
is comming from the call of s_accept
.
if(fd==INVALID_SOCKET) {
sockerror(msg);
return INVALID_SOCKET;
}
TL;DR stunnel fails to open (connect to) the socket(s) to listen on your system.
Is this a new Bug?
Package Name
stunnel
Package Version
v5.60-2 / 5.57-1
Device Model
DS211j
Device Architecture
ARMv5
Firmware Version
6.2.4
What happened?
After setting up a tunneling service (SSH), stunnel starts successfully as a client on the synology. However when trying to establish a connection through it (ssh user@SynologyIP -p StunnelAcceptPort), the ssh command hangs and the stunnel logs begin to flood with the following error message:
LOG3[ui]: local socket: Function not implemented (38)
I tried to toy with multiple options (different users including root, different ports, local ip binding, changing local socket options, ..) but no avail. Same configuration running on a laptop connects successfully.
Reproduction steps
Install Log
Service Log
No response
Other Logs