+2004-11-19 Ken Raeburn <raeburn@mit.edu>
+
+ * locate_kdc.c (krb5int_add_host_to_list): If debugging, log the
+ requested family and socket type. If AI_NUMERICSERV is defined,
+ set it in ai_flags. If getaddrinfo returns an error with
+ debugging enabled, log the error.
+ (krb5_locate_srv_conf_1): When logging an error from
+ add_host_to_list, include the corresponding error string.
+
+ * t_locate_kdc.c: Include port-sockets.h, instead of sys/socket.h,
+ netdb.h, netinet/in.h, and arpa/inet.h.
+ * Makefile.in ($(OUTPRE)t_locate_kdc.exe): New target.
+
2004-10-20 Ken Raeburn <raeburn@mit.edu>
* locate_kdc.c: Include stdarg.h.
$(CC_LINK) $(ALL_CFLAGS) -o t_locate_kdc t_locate_kdc.o \
$(KRB5_BASE_LIBS)
t_locate_kdc.o: t_locate_kdc.c locate_kdc.c
+$(OUTPRE)t_locate_kdc.exe: $(OUTPRE)t_locate_kdc.obj \
+ $(OUTPRE)dnssrv.obj $(OUTPRE)dnsglue.obj \
+ $(KLIB) $(PLIB) $(CLIB) $(SLIB)
+ link $(EXE_LINKOPTS) -out:$@ $** ws2_32.lib $(DNSLIBS)
LCLINT=lclint
LCLINTOPTS= -warnposix \
int err;
char portbuf[10], secportbuf[10];
- Tprintf ("adding hostname %s, ports %d,%d\n", hostname,
- ntohs (port), ntohs (secport));
+ Tprintf ("adding hostname %s, ports %d,%d, family %d, socktype %d\n",
+ hostname, ntohs (port), ntohs (secport),
+ family, socktype);
memset(&hint, 0, sizeof(hint));
hint.ai_family = family;
hint.ai_socktype = socktype;
+#ifdef AI_NUMERICSERV
+ hint.ai_flags = AI_NUMERICSERV;
+#endif
sprintf(portbuf, "%d", ntohs(port));
sprintf(secportbuf, "%d", ntohs(secport));
err = getaddrinfo (hostname, portbuf, &hint, &addrs);
- if (err)
+ if (err) {
+ Tprintf ("\tgetaddrinfo(\"%s\", \"%s\", ...)\n\treturns %d: %s\n",
+ hostname, portbuf, err, gai_strerror (err));
return translate_ai_error (err);
+ }
anext = 0;
for (a = addrs; a != 0 && err == 0; a = anext) {
anext = a->ai_next;
SOCK_STREAM, family);
}
if (code) {
- Tprintf ("error %d returned from add_host_to_list\n", code);
+ Tprintf ("error %d (%s) returned from add_host_to_list\n", code,
+ error_message (code));
if (hostlist)
profile_free_list (hostlist);
if (masterlist)
(strcmp("_tcp", protocol)
? SOCK_DGRAM
: SOCK_STREAM), family);
- if (code)
+ if (code) {
break;
+ }
if (entry == head) {
free(entry->host);
free(entry);