summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2011-01-03 14:55:54 -0500
committerNalin Dahyabhai <nalin@redhat.com>2011-01-03 14:55:54 -0500
commit25e0323d1c571c446c1b1daeb54654f446f7aec2 (patch)
treef3ce44dd5b4265d54c4f377413fd7f6102574b56
parentcf770b36c3afe2e84803dac195e8f4d8aab20a3d (diff)
downloadslapi-nis-25e0323d1c571c446c1b1daeb54654f446f7aec2.tar.gz
slapi-nis-25e0323d1c571c446c1b1daeb54654f446f7aec2.tar.xz
slapi-nis-25e0323d1c571c446c1b1daeb54654f446f7aec2.zip
- handle errors encountered while receiving datagram reqeusts (defect #10097)
-rw-r--r--src/disp-nis.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/disp-nis.c b/src/disp-nis.c
index 844ab80..b065ef7 100644
--- a/src/disp-nis.c
+++ b/src/disp-nis.c
@@ -447,8 +447,16 @@ dispatch_dgram(struct plugin_state *state, int fd)
reqsize = recvfrom(cdata.dgram.client_fd, dgram, sizeof(dgram), 0,
(struct sockaddr *) &cdata.dgram.client_addr,
&cdata.dgram.client_addrlen);
- slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
- "datagram request (%d bytes)\n", reqsize);
+ if (reqsize != -1) {
+ slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
+ "datagram request (%d bytes)\n", reqsize);
+ } else {
+ slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id,
+ "error reading datagram request: %s\n",
+ strerror(errno));
+ free(cdata.dgram.reply_buf);
+ return;
+ }
#ifdef HAVE_TCPD
/* Check tcp_wrappers access control. */
if ((request_set(state->request_info,