mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
noux: extent network errno handling
Add ECONNRESET, ECONNABORTED and EHOSTUNREACH. Issue #1810.
This commit is contained in:
parent
cebef2bda3
commit
50b8094d0d
@ -283,7 +283,9 @@ namespace Noux {
|
||||
enum Connect_error { CONNECT_ERR_ACCESS, CONNECT_ERR_AGAIN,
|
||||
CONNECT_ERR_ALREADY, CONNECT_ERR_CONN_REFUSED,
|
||||
CONNECT_ERR_NO_PERM, CONNECT_ERR_ADDR_IN_USE,
|
||||
CONNECT_ERR_IN_PROGRESS, CONNECT_ERR_IS_CONNECTED };
|
||||
CONNECT_ERR_IN_PROGRESS, CONNECT_ERR_IS_CONNECTED,
|
||||
CONNECT_ERR_RESET, CONNECT_ERR_ABORTED,
|
||||
CONNECT_ERR_NO_ROUTE };
|
||||
|
||||
enum Listen_error { LISTEN_ERR_ADDR_IN_USE, LISTEN_ERR_NOT_SUPPORTED };
|
||||
|
||||
|
@ -1888,12 +1888,15 @@ namespace {
|
||||
|
||||
if (!noux_syscall(Noux::Session::SYSCALL_CONNECT)) {
|
||||
switch (sysio()->error.connect) {
|
||||
case Noux::Sysio::CONNECT_ERR_AGAIN: errno = EAGAIN; break;
|
||||
case Noux::Sysio::CONNECT_ERR_ALREADY: errno = EALREADY; break;
|
||||
case Noux::Sysio::CONNECT_ERR_ADDR_IN_USE: errno = EADDRINUSE; break;
|
||||
case Noux::Sysio::CONNECT_ERR_IN_PROGRESS: errno = EINPROGRESS; break;
|
||||
case Noux::Sysio::CONNECT_ERR_IS_CONNECTED: errno = EISCONN; break;
|
||||
default: errno = 0; break;
|
||||
case Noux::Sysio::CONNECT_ERR_AGAIN: errno = EAGAIN; break;
|
||||
case Noux::Sysio::CONNECT_ERR_ALREADY: errno = EALREADY; break;
|
||||
case Noux::Sysio::CONNECT_ERR_ADDR_IN_USE: errno = EADDRINUSE; break;
|
||||
case Noux::Sysio::CONNECT_ERR_IN_PROGRESS: errno = EINPROGRESS; break;
|
||||
case Noux::Sysio::CONNECT_ERR_IS_CONNECTED: errno = EISCONN; break;
|
||||
case Noux::Sysio::CONNECT_ERR_RESET: errno = ECONNRESET; break;
|
||||
case Noux::Sysio::CONNECT_ERR_ABORTED: errno = ECONNABORTED; break;
|
||||
case Noux::Sysio::CONNECT_ERR_NO_ROUTE: errno = EHOSTUNREACH; break;
|
||||
default: errno = 0; break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -266,11 +266,15 @@ namespace Noux {
|
||||
|
||||
if (result == -1) {
|
||||
switch (errno) {
|
||||
case EAGAIN: sysio->error.connect = Sysio::CONNECT_ERR_AGAIN; break;
|
||||
case EALREADY: sysio->error.connect = Sysio::CONNECT_ERR_ALREADY; break;
|
||||
case EADDRINUSE: sysio->error.connect = Sysio::CONNECT_ERR_ADDR_IN_USE; break;
|
||||
case EINPROGRESS: sysio->error.connect = Sysio::CONNECT_ERR_IN_PROGRESS; break;
|
||||
case EISCONN: sysio->error.connect = Sysio::CONNECT_ERR_IS_CONNECTED; break;
|
||||
case EAGAIN: sysio->error.connect = Sysio::CONNECT_ERR_AGAIN; break;
|
||||
case EALREADY: sysio->error.connect = Sysio::CONNECT_ERR_ALREADY; break;
|
||||
case EADDRINUSE: sysio->error.connect = Sysio::CONNECT_ERR_ADDR_IN_USE; break;
|
||||
case EINPROGRESS: sysio->error.connect = Sysio::CONNECT_ERR_IN_PROGRESS; break;
|
||||
case EISCONN: sysio->error.connect = Sysio::CONNECT_ERR_IS_CONNECTED; break;
|
||||
case ECONNRESET: sysio->error.connect = Sysio::CONNECT_ERR_RESET; break;
|
||||
case ECONNABORTED: sysio->error.connect = Sysio::CONNECT_ERR_ABORTED; break;
|
||||
case EHOSTUNREACH: sysio->error.connect = Sysio::CONNECT_ERR_NO_ROUTE; break;
|
||||
|
||||
default:
|
||||
PDBG("unhandled errno: %d", errno);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user