From 91ea2b9f4e961a2a24001c8a9640132816a5fdfb Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 13 Apr 2007 05:44:38 +0000 Subject: [PATCH] Produce a more informative error message for KDC_UNREACH with KDC not responding git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19456 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/sendto_kdc.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib/krb5/os/sendto_kdc.c b/src/lib/krb5/os/sendto_kdc.c index b133ec7d2..e41ab89ba 100644 --- a/src/lib/krb5/os/sendto_kdc.c +++ b/src/lib/krb5/os/sendto_kdc.c @@ -397,7 +397,8 @@ krb5_sendto_kdc (krb5_context context, const krb5_data *message, if (addrs.naddrs > 0) { retval = krb5int_sendto (context, message, &addrs, 0, reply, 0, 0, 0, 0, &addr_used); - if (retval == 0) { + switch (retval) { + case 0: /* * Set use_master to 1 if we ended up talking to a master when * we didn't explicitly request to @@ -415,7 +416,15 @@ krb5_sendto_kdc (krb5_context context, const krb5_data *message, } krb5int_free_addrlist (&addrs); return 0; - } + default: + break; + /* Cases here are for constructing useful error messages. */ + case KRB5_KDC_UNREACH: + krb5_set_error_message(context, retval, + "Cannot contact any KDC for realm '%.*s'", + realm->length, realm->data); + break; + } krb5int_free_addrlist (&addrs); } return retval; -- 2.26.2