+2002-07-22 Ken Raeburn <raeburn@mit.edu>
+
+ * sendmsg.c (krb524_sendto_kdc): Accept new arguments for local
+ address; pass them through to sendto_udp.
+ * krb524.h: Include port-sockets.h.
+ (krb524_sendto_kdc): Update declaration.
+ * conv_creds.c: Include socket-utils.h.
+ (krb524_convert_creds_kdc): Get local-address info from
+ krb524_sendto_kdc. On Mac, store the IPv4 address in the v4
+ credentials.
+
+2002-07-19 Ken Raeburn <raeburn@mit.edu>
+
+ * sendmsg.c (krb524_sendto_kdc): Accept new args for local address
+ return, pass them through to sendto_udp.
+ * conv_creds.c: Include socket-utils.h.
+ (krb524_convert_creds_kdc):
+
2002-07-12 Ken Raeburn <raeburn@mit.edu>
* conv_creds.c: Include port-sockets.h instead of winsock.h or
#include <string.h>
#include <sys/types.h>
#include "port-sockets.h"
+#include "socket-utils.h"
#if TARGET_OS_MAC
#include <Kerberos/krb.h>
#include <Kerberos/krb524.h>
krb5_error_code ret;
krb5_data reply;
char *p;
+ struct sockaddr_storage ss;
+ socklen_t slen = sizeof(ss);
ret = krb524_convert_creds_plain(context, v5creds, v4creds);
if (ret)
reply.data = NULL;
ret = krb524_sendto_kdc(context, &v5creds->ticket,
- &v5creds->server->realm, &reply);
+ &v5creds->server->realm, &reply,
+ ss2sa(&ss), &slen);
if (ret)
return ret;
+#ifdef TARGET_OS_MAC
+ if (slen == sizeof(struct sockaddr_in)
+ && ss2sa(&ss)->sa_family == AF_INET) {
+ v4creds->address = ss2sin(&ss)->sin_addr.s_addr;
+ }
+ /* Otherwise, leave it set to all-zero. */
+#endif
+
p = reply.data;
ret = ntohl(*((krb5_error_code *) p));
p += sizeof(krb5_int32);
/* sendmsg.c */
+#include "port-sockets.h" /* for socklen_t */
int krb524_sendto_kdc
(krb5_context context, const krb5_data * message,
- const krb5_data * realm, krb5_data * reply);
+ const krb5_data * realm, krb5_data * reply,
+ struct sockaddr *, socklen_t *);
#endif /* KRB524_PRIVATE */
#if TARGET_OS_MAC
*/
krb5_error_code
-krb524_sendto_kdc (context, message, realm, reply)
+krb524_sendto_kdc (context, message, realm, reply, addr, addrlen)
krb5_context context;
const krb5_data * message;
const krb5_data * realm;
krb5_data * reply;
+ struct sockaddr *addr;
+ socklen_t *addrlen;
{
int i;
struct addrlist al = ADDRLIST_INIT;
if (al.naddrs == 0)
return KRB5_REALM_UNKNOWN;
- retval = internals.sendto_udp (context, message, &al, reply, 0, 0);
+ retval = internals.sendto_udp (context, message, &al, reply, addr,
+ addrlen);
internals.free_addrlist (&al);
return retval;
}