(add_addrs): don't add same address multiple times

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13257 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2004-01-05 15:17:25 +00:00
parent 85575388c3
commit dd1875d0a5

View File

@@ -62,9 +62,15 @@ add_addrs(krb5_context context,
}
i = addr->len;
for (a = ai; a != NULL; a = a->ai_next) {
ret = krb5_sockaddr2address (context, a->ai_addr, &addr->val[i]);
if (ret == 0)
++i;
krb5_address ad;
ret = krb5_sockaddr2address (context, a->ai_addr, &ad);
if (ret == 0) {
if (krb5_address_search(context, &ad, addr))
krb5_free_address(context, &ad);
else
addr->val[i++] = ad;
}
else if (ret == KRB5_PROG_ATYPE_NOSUPP)
krb5_clear_error_string (context);
else