gethtbyname: Reserve space for mapping IPv4 address to IPv6 address

Currently function return address space size is reserved by the address
family. When Netd does IPv6 prefix synthesis on an IPv4 resource record,
hostent structure has no enough address space for synthesized IPv6 address.
Reserving enough address space for either IPv4 or IPv6 avoids buffer
overflow while doing address family remapping in Netd.

Be aware of that we don't reserve address space for family remapping in
numeric hostname query which returns a fake address from numeric hostname.
The reason is this case doesn't trigger DNS64 synthesis in Netd.

Bug: 78545619
Test: netd_{unit,integration}_test pass
Change-Id: I506026cfa38c107e06440806a3080dd8d52a3bf2
2 files changed