(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:
@@ -168,6 +168,10 @@ find_all_addresses (krb5_context context,
|
|||||||
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
|
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
|
||||||
sz = max(sz, sizeof(ifr->ifr_name) + sa->sa_len);
|
sz = max(sz, sizeof(ifr->ifr_name) + sa->sa_len);
|
||||||
#endif
|
#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));
|
memcpy (ifreq.ifr_name, ifr->ifr_name, sizeof(ifr->ifr_name));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user