summaryrefslogtreecommitdiff
path: root/omapip/buffer.c
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2001-04-20 20:14:07 +0000
committerTed Lemon <source@isc.org>2001-04-20 20:14:07 +0000
commitc1d58ae6ecdbaf69f63a838cde9644b4d0f9298f (patch)
tree19bbb4b32836d90f12feba95e294f69e6b887b5f /omapip/buffer.c
parent06fa897b5ec4d7b1836d0c747d9883851b570617 (diff)
downloadisc-dhcp-c1d58ae6ecdbaf69f63a838cde9644b4d0f9298f.tar.gz
Don't allow writes on a closed connection.
Diffstat (limited to 'omapip/buffer.c')
-rw-r--r--omapip/buffer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/omapip/buffer.c b/omapip/buffer.c
index 253da9e1..d007a23a 100644
--- a/omapip/buffer.c
+++ b/omapip/buffer.c
@@ -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)