(find_all_addresses): try to handle the case of getting back an

`sockaddr_in6' address when sizeof(struct sockaddr_in6) >
sizeof(struct sockaddr) and we have no sa_len to tell us how large the
address is.  This obviously doesn't work with unknown protocol types.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6514 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-07-24 00:45:14 +00:00
parent ae074b294d
commit 4ff4b6c5f0

View File

@@ -168,6 +168,10 @@ find_all_addresses (krb5_context context,
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
sz = max(sz, sizeof(ifr->ifr_name) + sa->sa_len);
#endif
#ifdef AF_INET6
if (sa->sa_family == AF_INET6)
sz = max(sz, sizeof(ifr->ifr_name) + sizeof(struct sockaddr_in6));
#endif
memcpy (ifreq.ifr_name, ifr->ifr_name, sizeof(ifr->ifr_name));