From: Ken Raeburn Date: Fri, 13 Apr 2007 05:44:38 +0000 (+0000) Subject: Produce a more informative error message for KDC_UNREACH with KDC not responding X-Git-Tag: krb5-1.7-alpha1~1153 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=91ea2b9f4e961a2a24001c8a9640132816a5fdfb;p=krb5.git 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 --- 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;