From b19582329ff3831f4a8d1415a5d8427a06107d09 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Thu, 26 Jan 2012 22:05:25 +0000 Subject: [PATCH] Clean up dispatch lookaside code slightly Always log when we get a lookaside cache hit, eliminating a confusing conditional. This is a slight behavior change because we never used to log a lookaside cache hit when we can't deliver the response via UDP, but that was never really deliberate or important--we log all sorts of stuff about responses which might turn out to be too big. Also eliminate a signed/unsigned comparison warning in finish_dispatch. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25661 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/dispatch.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/kdc/dispatch.c b/src/kdc/dispatch.c index efe709881..adbb0c3bf 100644 --- a/src/kdc/dispatch.c +++ b/src/kdc/dispatch.c @@ -51,7 +51,7 @@ finish_dispatch(struct dispatch_state *state, krb5_error_code code, void *oldarg = state->arg; if (state->is_tcp == 0 && response && - response->length > max_dgram_reply_size) { + response->length > (unsigned int)max_dgram_reply_size) { krb5_free_data(kdc_context, response); response = NULL; code = make_too_big_error(&response); @@ -114,22 +114,19 @@ dispatch(void *cb, struct sockaddr *local_saddr, const char *name = 0; char buf[46]; - if (!response || is_tcp != 0 || - response->length <= max_dgram_reply_size) { - name = inet_ntop (ADDRTYPE2FAMILY (from->address->addrtype), - from->address->contents, buf, sizeof (buf)); - if (name == 0) - name = "[unknown address type]"; - if (response) - krb5_klog_syslog(LOG_INFO, - "DISPATCH: repeated (retransmitted?) request " - "from %s, resending previous response", name); - else - krb5_klog_syslog(LOG_INFO, - "DISPATCH: repeated (retransmitted?) request " - "from %s during request processing, dropping " - "repeated request", name); - } + name = inet_ntop (ADDRTYPE2FAMILY (from->address->addrtype), + from->address->contents, buf, sizeof (buf)); + if (name == 0) + name = "[unknown address type]"; + if (response) + krb5_klog_syslog(LOG_INFO, + "DISPATCH: repeated (retransmitted?) request " + "from %s, resending previous response", name); + else + krb5_klog_syslog(LOG_INFO, + "DISPATCH: repeated (retransmitted?) request " + "from %s during request processing, dropping " + "repeated request", name); finish_dispatch(state, response ? 0 : KRB5KDC_ERR_DISCARD, response); return; -- 2.26.2