summaryrefslogtreecommitdiff
path: root/source/libads/kerberos.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-01-17 19:11:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:14 -0500
commita9baf27e1348dd6dadd7a2fafdf9c269087b80ac (patch)
treef4530df810682567d3ba5e0170e99515e8d51a2e /source/libads/kerberos.c
parenta1d0644d156c360d52fb837d3eecddb202135ebe (diff)
downloadsamba-a9baf27e1348dd6dadd7a2fafdf9c269087b80ac.tar.gz
r20860: Adding some small tweaks. When we have no sitename, there is no need to
ask for the list of DCs twice. Guenther
Diffstat (limited to 'source/libads/kerberos.c')
-rw-r--r--source/libads/kerberos.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/source/libads/kerberos.c b/source/libads/kerberos.c
index 95eed6fe27f..d35b59f4cdb 100644
--- a/source/libads/kerberos.c
+++ b/source/libads/kerberos.c
@@ -484,18 +484,21 @@ static char *get_kdc_ip_string(char *mem_ctx, const char *realm, const char *sit
/* Get the KDC's only in this site. */
- get_kdc_list(realm, sitename, &ip_srv_site, &count_site);
+ if (sitename) {
- for (i = 0; i < count_site; i++) {
- if (ip_equal(ip_srv_site[i].ip, primary_ip)) {
- continue;
- }
- /* Append to the string - inefficient but not done often. */
- kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n",
- kdc_str, inet_ntoa(ip_srv_site[i].ip));
- if (!kdc_str) {
- SAFE_FREE(ip_srv_site);
- return NULL;
+ get_kdc_list(realm, sitename, &ip_srv_site, &count_site);
+
+ for (i = 0; i < count_site; i++) {
+ if (ip_equal(ip_srv_site[i].ip, primary_ip)) {
+ continue;
+ }
+ /* Append to the string - inefficient but not done often. */
+ kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n",
+ kdc_str, inet_ntoa(ip_srv_site[i].ip));
+ if (!kdc_str) {
+ SAFE_FREE(ip_srv_site);
+ return NULL;
+ }
}
}