summaryrefslogtreecommitdiffstats
path: root/src/kdc/kdc_util.h
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2002-07-05 19:56:15 +0000
committerKen Raeburn <raeburn@mit.edu>2002-07-05 19:56:15 +0000
commitfc50ce3d9d7221d156aa0e4e8fc2ffad2e52599f (patch)
tree1e573a902fb8b2e3a3f758cd946e2af6ca3be31e /src/kdc/kdc_util.h
parentc549539adaf8cb98b32a2f178a351906cdb20653 (diff)
downloadkrb5-fc50ce3d9d7221d156aa0e4e8fc2ffad2e52599f.tar.gz
krb5-fc50ce3d9d7221d156aa0e4e8fc2ffad2e52599f.tar.xz
krb5-fc50ce3d9d7221d156aa0e4e8fc2ffad2e52599f.zip
Reduce or localize dependencies on address families.
* kdc_util.h (ADDRTYPE2FAMILY): New macro. * do_as_req.c (process_as_req): Use inet_ntop instead of inet_ntoa. * do_tgs_req.c (process_tgs_req): Ditto. * dispatch.c (dispatch): Fix inet_ntop code, and use it always. * kerberos_v4.c (process_v4): Check address family before copying out an IPv4 address. Log if not IPv4, but continue. * network.c (set_sa_port): New function. (setup_port): Use it. Combine IPv4 and IPv6 paths; IPv6 still disabled for now. Modify supplied sockaddr instead of making a copy. (process_packet): SADDR is now sockaddr_storage. Use socket-utils macros instead of casting. Enable the IPv6 code. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14602 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kdc/kdc_util.h')
-rw-r--r--src/kdc/kdc_util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/kdc/kdc_util.h b/src/kdc/kdc_util.h
index 8e6625262..8e48932e4 100644
--- a/src/kdc/kdc_util.h
+++ b/src/kdc/kdc_util.h
@@ -184,4 +184,12 @@ void process_v4_mode (const char *, const char *);
#define max(a, b) ((a) > (b) ? (a) : (b))
#endif
+#ifdef KRB5_USE_INET6
+#define ADDRTYPE2FAMILY(X) \
+ ((X) == ADDRTYPE_INET6 ? AF_INET6 : (X) == ADDRTYPE_INET ? AF_INET : -1)
+#else
+#define ADDRTYPE2FAMILY(X) \
+ ((X) == ADDRTYPE_INET ? AF_INET : -1)
+#endif
+
#endif /* __KRB5_KDC_UTIL__ */