diff options
author | Ted Lemon <source@isc.org> | 2000-05-03 06:12:28 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 2000-05-03 06:12:28 +0000 |
commit | d86ec998a2bebdb1dd3b821dac1daac6dda926a7 (patch) | |
tree | c65bc56346a9eca0626d6004a659bc89be3c2b41 /omapip/connection.c | |
parent | dc22b3875b116b8814c3f12277902e322f4e395a (diff) | |
download | isc-dhcp-d86ec998a2bebdb1dd3b821dac1daac6dda926a7.tar.gz |
Get rid of SO_USELOOPBACK. Use omapi_unregister_io_object.
Diffstat (limited to 'omapip/connection.c')
-rw-r--r-- | omapip/connection.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/omapip/connection.c b/omapip/connection.c index 35096c33..194d30ee 100644 --- a/omapip/connection.c +++ b/omapip/connection.c @@ -177,14 +177,6 @@ isc_result_t omapi_connect_list (omapi_object_t *c, return ISC_R_UNEXPECTED; } - /* Set the SO_USELOOPBACK flag (this should not fail). */ - flag = 1; - if (setsockopt (obj -> socket, SOL_SOCKET, SO_USELOOPBACK, - (char *)&flag, sizeof flag) < 0) { - omapi_object_dereference ((omapi_object_t **)&obj, MDL); - return ISC_R_UNEXPECTED; - } - /* Set the file to nonblocking mode. */ if (fcntl (obj -> socket, F_SETFL, O_NONBLOCK) < 0) { omapi_object_dereference ((omapi_object_t **)&obj, MDL); @@ -318,7 +310,7 @@ isc_result_t omapi_connection_connect (omapi_object_t *h) omapi_disconnect (h, 1); return ISC_R_SUCCESS; } - if (!errno) + if (!error) c -> state = omapi_connection_connected; } if (c -> state == omapi_connection_connecting || @@ -347,10 +339,12 @@ isc_result_t omapi_connection_connect (omapi_object_t *h) sizeof c -> remote_addr.sin_zero); ++c -> cptr; - if (connect (c -> socket, - (struct sockaddr *)&c -> remote_addr, - sizeof c -> remote_addr) < 0) { - if (errno != EINPROGRESS) { + error = connect (c -> socket, + (struct sockaddr *)&c -> remote_addr, + sizeof c -> remote_addr); + if (error < 0) { + error = errno; + if (error != EINPROGRESS) { omapi_disconnect (h, 1); return ISC_R_UNEXPECTED; } @@ -369,7 +363,7 @@ isc_result_t omapi_connection_connect (omapi_object_t *h) /* Disconnect from I/O object, if any. */ if (h -> outer) - omapi_object_dereference (&h -> outer, MDL); + omapi_unregister_io_object (h); status = omapi_register_io_object (h, omapi_connection_readfd, |