diff options
Diffstat (limited to 'src/krb524/sendmsg.c')
-rw-r--r-- | src/krb524/sendmsg.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/krb524/sendmsg.c b/src/krb524/sendmsg.c index 77e8f3bf7..8170891b4 100644 --- a/src/krb524/sendmsg.c +++ b/src/krb524/sendmsg.c @@ -30,12 +30,14 @@ #define NEED_LOWLEVEL_IO #include "k5-int.h" +#ifndef _WIN32 #include <unistd.h> +#include <sys/time.h> +#endif + #include <stdlib.h> #include <string.h> -#include <sys/time.h> - #ifdef _AIX #include <sys/select.h> #endif @@ -43,9 +45,6 @@ #include <krb.h> #include "krb524.h" -/* For krb5_locate_kdc() */ -#include <k5-int.h> - /* * krb524_sendto_kdc: * @@ -61,11 +60,6 @@ * when finished. */ -extern int krb5_max_dgram_size; -extern int krb5_max_skdc_timeout; -extern int krb5_skdc_timeout_shift; -extern int krb5_skdc_timeout_1; - krb5_error_code krb524_sendto_kdc (context, message, realm, reply) krb5_context context; @@ -83,12 +77,15 @@ krb524_sendto_kdc (context, message, realm, reply) fd_set readable; struct timeval waitlen; int cc; + krb5int_access internals; + if (retval = krb5int_accessor(&internals, KRB5INT_ACCESS_VERSION)) + return retval; /* * find KDC location(s) for realm */ - if ((retval = krb5_locate_kdc(context, realm, &addr, &naddr, NULL, NULL))) + if ((retval = internals.krb5_locate_kdc(context, realm, &addr, &naddr, 0))) return retval; if (naddr == 0) return KRB5_REALM_UNKNOWN; @@ -111,12 +108,12 @@ krb524_sendto_kdc (context, message, realm, reply) else ((struct sockaddr_in *)&addr[i])->sin_port = htons(KRB524_PORT); - if (!(reply->data = malloc(krb5_max_dgram_size))) { + if (!(reply->data = malloc(internals.krb5_max_dgram_size))) { free(addr); free(socklist); return ENOMEM; } - reply->length = krb5_max_dgram_size; + reply->length = internals.krb5_max_dgram_size; #if 0 /* @@ -137,8 +134,8 @@ krb524_sendto_kdc (context, message, realm, reply) * do exponential backoff. */ - for (timeout = krb5_skdc_timeout_1; timeout < krb5_max_skdc_timeout; - timeout <<= krb5_skdc_timeout_shift) { + for (timeout = internals.krb5_skdc_timeout_1; timeout < internals.krb5_max_skdc_timeout; + timeout <<= internals.krb5_skdc_timeout_shift) { sent = 0; for (host = 0; host < naddr; host++) { /* send to the host, wait timeout seconds for a response, |