mirror of
https://sourceware.org/git/glibc.git
synced 2025-06-07 22:42:06 +03:00
The IPv4 address parser in the getaddrinfo function is changed so that it does not ignore trailing whitespace and all characters after it. For backwards compatibility, the getaddrinfo function still recognizes legacy name syntax, such as 192.000.002.010 interpreted as 192.0.2.8 (octal). This commit does not change the behavior of inet_addr and inet_aton. gethostbyname already had additional sanity checks (but is switched over to the new __inet_aton_exact function for completeness as well). To avoid sending the problematic query names over DNS, commit 6ca53a2453598804a2559a548a08424fca96434a ("resolv: Do not send queries for non-host-names in nss_dns [BZ #24112]") is needed.
16 lines
472 B
C
16 lines
472 B
C
#include <inet/arpa/inet.h>
|
|
|
|
#ifndef _ISOMAC
|
|
/* Variant of inet_aton which rejects trailing garbage. */
|
|
extern int __inet_aton_exact (const char *__cp, struct in_addr *__inp);
|
|
libc_hidden_proto (__inet_aton_exact)
|
|
|
|
libc_hidden_proto (inet_ntop)
|
|
libc_hidden_proto (inet_pton)
|
|
extern __typeof (inet_pton) __inet_pton;
|
|
libc_hidden_proto (__inet_pton)
|
|
extern __typeof (inet_makeaddr) __inet_makeaddr;
|
|
libc_hidden_proto (__inet_makeaddr)
|
|
libc_hidden_proto (inet_netof)
|
|
#endif
|