+2002-07-07 Ken Raeburn <raeburn@mit.edu>
+
+ * k5-int.h: Always include socket support headers; don't check
+ NEED_SOCKETS.
+ (krb5int_sendto_udp): Update prototype.
+ (struct _krb5int_access): Update sendto_udp field declaracion to
+ match krb5int_sendto_udp.
+
2002-07-05 Ken Raeburn <raeburn@mit.edu>
* port-sockets.h (SOCKET_WRITEV) [!_WIN32]: Use TMP after setting
#include <errno.h>
#include "krb5.h"
-#ifdef NEED_SOCKETS
+#if 1 /* def NEED_SOCKETS */
#include "port-sockets.h"
#include "socket-utils.h"
#else
krb5_error_code krb5_sendto_kdc (krb5_context, const krb5_data *,
const krb5_data *, krb5_data *, int, int);
krb5_error_code krb5int_sendto_udp (krb5_context, const krb5_data *,
- const struct addrlist *, krb5_data *);
+ const struct addrlist *, krb5_data *,
+ struct sockaddr *, socklen_t *);
krb5_error_code krb5int_sendto_tcp (krb5_context context, const krb5_data *,
const struct addrlist *, krb5_data *);
krb5_error_code krb5_get_krbhst (krb5_context, const krb5_data *, char *** );
unsigned int icount, const krb5_data *input,
krb5_data *output);
krb5_error_code (*sendto_udp) (krb5_context, const krb5_data *msg,
- const struct addrlist *, krb5_data *reply);
+ const struct addrlist *, krb5_data *reply,
+ struct sockaddr *, socklen_t *);
} krb5int_access;
#define KRB5INT_ACCESS_VERSION \
+2002-07-07 Ken Raeburn <raeburn@mit.edu>
+
+ * sendmsg.c (krb524_sendto_kdc): Update sendto_udp calling
+ sequence; pass 0 for now.
+
2002-06-14 Tom Yu <tlyu@mit.edu>
* krb524.h: Change multiple-inclusion test macro to not stomp on
if (al.naddrs == 0)
return KRB5_REALM_UNKNOWN;
- retval = internals.sendto_udp (context, message, &al, reply);
+ retval = internals.sendto_udp (context, message, &al, reply, 0, 0);
internals.free_addrlist (&al);
return retval;
}
+2002-07-08 Ken Raeburn <raeburn@mit.edu>
+
+ * sendto_kdc.c (krb5int_sendto_udp): Accept new args for optional
+ location to store local address used to contact server.
+ (krb5_sendto_kdc): Update call to pass 0.
+
2002-07-05 Ken Raeburn <raeburn@mit.edu>
* sendto_kdc.c (service_tcp_fd): sockerrlen should have type
&& message->length < 1500
&& ! krb5_locate_kdc(context, realm, &addrs, use_master, SOCK_DGRAM)) {
if (addrs.naddrs > 0) {
- retval = krb5int_sendto_udp (context, message, &addrs, reply);
+ retval = krb5int_sendto_udp (context, message, &addrs, reply,
+ 0, 0);
krb5int_free_addrlist (&addrs);
if (retval == 0)
return 0;
krb5_error_code
krb5int_sendto_udp (krb5_context context, const krb5_data *message,
- const struct addrlist *addrs, krb5_data *reply)
+ const struct addrlist *addrs, krb5_data *reply,
+ struct sockaddr *localaddr, socklen_t *localaddrlen)
{
int host, i;
unsigned int timeout;
reply->length = cc;
retval = 0;
dfprintf((stderr, "got answer on fd %d\n", socklist[host]));
+ if (localaddr != 0 && localaddrlen != 0 && *localaddrlen > 0) {
+ if (getsockname(socklist[host], localaddr, localaddrlen) == SOCKET_ERROR) {
+ /* Don't report it, just go on. */
+#ifdef DEBUG
+ dperror("getsockname");
+#endif
+ *localaddrlen = 0;
+ }
+ }
goto out;
} else if (nready == 0) {
/* timeout */