get_ai: Allocate socket address space for struct sockaddr_union

Currently socket address space is allocated by the address family. When Netd
does IPv6 prefix synthesis on an IPv4 resource record, Netd can't directly cast
a sockaddr_in pointer to a sockaddr_in6 pointer for reporting synthesized IPv6
address. The size of sockaddr_union is enough for either an IPv6 or IPv4
address. It allows that a socket address can be directly cast as
a protocol-specific (IPv4/IPv6) address structure.

Bug: 78545619
Test: netd_{unit,integration}_test pass
Change-Id: I49fcba89a7de59a5ca49933f84887177c5500425
1 file changed