diff options
author | Greg Hudson <ghudson@mit.edu> | 2012-01-26 22:05:25 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2012-01-26 22:05:25 +0000 |
commit | b19582329ff3831f4a8d1415a5d8427a06107d09 (patch) | |
tree | 3c9a8fa1ea37cfd3d819d28d4cf174dc3706db04 /src/kdc/dispatch.c | |
parent | 548f8461c75c5638f0c24ca86364a17f59619b89 (diff) | |
download | krb5-b19582329ff3831f4a8d1415a5d8427a06107d09.tar.gz krb5-b19582329ff3831f4a8d1415a5d8427a06107d09.tar.xz krb5-b19582329ff3831f4a8d1415a5d8427a06107d09.zip |
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
Diffstat (limited to 'src/kdc/dispatch.c')
-rw-r--r-- | src/kdc/dispatch.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/kdc/dispatch.c b/src/kdc/dispatch.c index efe7098814..adbb0c3bfe 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; |