]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Don't allow writes on a closed connection.
authorTed Lemon <source@isc.org>
Fri, 20 Apr 2001 20:14:07 +0000 (20:14 +0000)
committerTed Lemon <source@isc.org>
Fri, 20 Apr 2001 20:14:07 +0000 (20:14 +0000)
omapip/buffer.c

index 253da9e1f0835e2f1257ebd0e9015c0b743e663f..d007a23a0568d04a7facb4848f67999873610ac0 100644 (file)
@@ -292,6 +292,12 @@ isc_result_t omapi_connection_copyin (omapi_object_t *h,
                return ISC_R_INVALIDARG;
        c = (omapi_connection_object_t *)h;
 
+       /* If the connection is closed, return an error if the caller
+          tries to copy in. */
+       if (c -> state == omapi_connection_disconnecting ||
+           c -> state == omapi_connection_closed)
+               return ISC_R_NOTCONNECTED;
+
        if (c -> outbufs) {
                for (buffer = c -> outbufs;
                     buffer -> next; buffer = buffer -> next)