Permalink
Browse files

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
  • Loading branch information...
ghudson
ghudson committed Jan 26, 2012
1 parent 4b9eb1f commit 1d88207c3e5f65b1acc35ffc9341a49d75fcbb26
Showing with 14 additions and 17 deletions.
  1. +14 −17 src/kdc/dispatch.c
View
@@ -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;

0 comments on commit 1d88207

Please sign in to comment.