summaryrefslogtreecommitdiff
path: root/omapip/connection.c
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2000-05-03 06:12:28 +0000
committerTed Lemon <source@isc.org>2000-05-03 06:12:28 +0000
commitd86ec998a2bebdb1dd3b821dac1daac6dda926a7 (patch)
treec65bc56346a9eca0626d6004a659bc89be3c2b41 /omapip/connection.c
parentdc22b3875b116b8814c3f12277902e322f4e395a (diff)
downloadisc-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.c22
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,