mirror of
https://kernel.googlesource.com/pub/scm/network/tftp/tftp-hpa
synced 2025-04-26 01:49:52 +03:00
Fix numeric IPv6 address handling
The following patch sets additional hints to restrict the addresses returned by getaddrinfo() to specify preferred socket type, protocol and a flag to return only v4/v6 addresses based on the configured addresses. Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
544abd789e
commit
740871b0f5
1 changed files with 3 additions and 1 deletions
|
@ -308,7 +308,9 @@ set_sock_addr(char *host,union sock_addr *s, char **name)
|
|||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = s->sa.sa_family;
|
||||
hints.ai_flags = AI_CANONNAME;
|
||||
hints.ai_flags = AI_CANONNAME | AI_ADDRCONFIG;
|
||||
hints.ai_socktype = SOCK_DGRAM;
|
||||
hints.ai_protocol = IPPROTO_UDP;
|
||||
err = getaddrinfo(strip_address(host), NULL, &hints, &addrResult);
|
||||
if (err)
|
||||
return err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue