+2003-06-06 Ken Raeburn <raeburn@mit.edu>
+
+ * locate_kdc.c (struct srv_dns_entry): Moved to k5-int.h.
+ (krb5int_make_srv_query_realm): Renamed from make_srv_query_realm.
+ (krb5int_free_srv_dns_data): New function.
+ (krb5_locate_srv_dns_1): Use it.
+
+ * accessor.c (krb5int_accessor): Fill in make_srv_query_realm and
+ free_srv_dns_data fields.
+
2003-06-05 Ken Raeburn <raeburn@mit.edu>
* locate_kdc.c (make_srv_query_realm): Punt if strdup fails.
internals_temp.locate_server = &krb5int_locate_server;
internals_temp.sendto_udp = &krb5int_sendto;
internals_temp.add_host_to_list = krb5int_add_host_to_list;
+#ifdef KRB5_DNS_LOOKUP
+ internals_temp.make_srv_query_realm = krb5int_make_srv_query_realm;
+ internals_temp.free_srv_dns_data = krb5int_free_srv_dns_data;
+#else
+ internals_temp.make_srv_query_realm = 0;
+ internals_temp.free_srv_dns_data = 0;
+#endif
#ifdef KRB5_KRB4_COMPAT
internals_temp.krb_life_to_time = krb5int_krb_life_to_time;
internals_temp.krb_time_to_life = krb5int_krb_time_to_life;
* Lookup a KDC via DNS SRV records
*/
-struct srv_dns_entry {
+void krb5int_free_srv_dns_data (struct srv_dns_entry *p)
+{
struct srv_dns_entry *next;
- int priority;
- int weight;
- unsigned short port;
- char *host;
-};
+ while (p) {
+ next = p->next;
+ free(p->host);
+ free(p);
+ p = next;
+ }
+}
/* Do DNS SRV query, return results in *answers.
Make best effort to return all the data we can. On memory or
decoding errors, just return what we've got. Always return 0,
currently. */
-static krb5_error_code
-make_srv_query_realm(const krb5_data *realm,
- const char *service,
- const char *protocol,
- struct srv_dns_entry **answers)
+#define make_srv_query_realm krb5int_make_srv_query_realm
+
+krb5_error_code
+krb5int_make_srv_query_realm(const krb5_data *realm,
+ const char *service,
+ const char *protocol,
+ struct srv_dns_entry **answers)
{
union {
unsigned char bytes[2048];
fprintf (stderr, "[end]\n");
#endif
- for (entry = head; entry != NULL; ) {
- struct srv_dns_entry *srv;
- free(entry->host);
- entry->host = NULL;
- srv = entry;
- entry = entry->next;
- free(srv);
- }
-
+ krb5int_free_srv_dns_data(head);
return code;
}
#endif /* KRB5_DNS_LOOKUP */