summaryrefslogtreecommitdiffstats
path: root/src/krb524/sendmsg.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2002-06-04 06:59:28 +0000
committerKen Raeburn <raeburn@mit.edu>2002-06-04 06:59:28 +0000
commitb02232ffdf69f75caaf10c78e00a9fa8f93b3286 (patch)
tree8324d8d24db2a4b72d95cfe57c7762355e5edd81 /src/krb524/sendmsg.c
parent53c8f6650caef85bb9b38f23e0e50965d50d26f6 (diff)
downloadkrb5-b02232ffdf69f75caaf10c78e00a9fa8f93b3286.tar.gz
krb5-b02232ffdf69f75caaf10c78e00a9fa8f93b3286.tar.xz
krb5-b02232ffdf69f75caaf10c78e00a9fa8f93b3286.zip
Add capability of looking up TCP addresses for KDC in DNS; not enabled yet.
Internal "addrlist" structure now includes socket type, by way of using struct addrinfo where struct sockaddr was used before; updated uses. No support for noting TCP/UDP vs UDP-only addresses in config files. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14465 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/krb524/sendmsg.c')
-rw-r--r--src/krb524/sendmsg.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/krb524/sendmsg.c b/src/krb524/sendmsg.c
index 00c55f0d2a..2335dad316 100644
--- a/src/krb524/sendmsg.c
+++ b/src/krb524/sendmsg.c
@@ -28,6 +28,7 @@
/* Grab socket stuff. This might want to go away later. */
#define NEED_SOCKETS
#define NEED_LOWLEVEL_IO
+#include "fake-addrinfo.h" /* for custom addrinfo if needed */
#include "k5-int.h"
#ifndef _WIN32
@@ -101,8 +102,8 @@ krb524_sendto_kdc (context, message, realm, reply)
*/
if (retval == 0)
for (i = 0; i < al.naddrs; i++) {
- if (al.addrs[i]->sa_family == AF_INET)
- sa2sin (al.addrs[i])->sin_port = port;
+ if (al.addrs[i]->ai_family == AF_INET)
+ sa2sin (al.addrs[i]->ai_addr)->sin_port = port;
}
}
if (retval)
@@ -163,7 +164,7 @@ krb524_sendto_kdc (context, message, realm, reply)
* protocol exists to support a particular socket type
* within a given protocol family.
*/
- socklist[host] = socket(al.addrs[host]->sa_family, SOCK_DGRAM,
+ socklist[host] = socket(al.addrs[host]->ai_family, SOCK_DGRAM,
0);
if (socklist[host] == INVALID_SOCKET)
continue; /* try other hosts */
@@ -173,8 +174,8 @@ krb524_sendto_kdc (context, message, realm, reply)
socket will time out, so use connect, send, recv instead of
sendto, recvfrom. The connect here may return an error if
the destination host is known to be unreachable. */
- if (connect(socklist[host], al.addrs[host],
- socklen(al.addrs[host])) == SOCKET_ERROR)
+ if (connect(socklist[host], al.addrs[host]->ai_addr,
+ al.addrs[host]->ai_addrlen) == SOCKET_ERROR)
continue;
}
if (send(socklist[host], message->data, (int) message->length, 0)