mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
Replace getquad() with inet_pton()
getquad() was implemented back in 2001 to warn about IPv4 addresses in non-dotted-quad form being used. As change 4900 (GL #13) removed all uses of inet_aton(), which allowed such forms, with inet_pton(), which does not allow them, there is no point in keeping getquad() around as it now only prints an extra warning when the parser comes across an IP address in a form which is not acceptable anyway. Replace all uses of getquad() with inet_pton(AF_INET, ...).
This commit is contained in:
@@ -378,24 +378,6 @@ locator_pton(const char *src, unsigned char *dst) {
|
||||
return (1);
|
||||
}
|
||||
|
||||
static inline int
|
||||
getquad(const void *src, struct in_addr *dst,
|
||||
isc_lex_t *lexer, dns_rdatacallbacks_t *callbacks)
|
||||
{
|
||||
int result;
|
||||
|
||||
result = inet_pton(AF_INET, src, dst);
|
||||
if (result != 1 && callbacks != NULL) {
|
||||
const char *name = isc_lex_getsourcename(lexer);
|
||||
if (name == NULL)
|
||||
name = "UNKNOWN";
|
||||
(*callbacks->warn)(callbacks, "%s:%lu: \"%s\" "
|
||||
"is not a decimal dotted quad", name,
|
||||
isc_lex_getsourceline(lexer), src);
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
name_duporclone(const dns_name_t *source, isc_mem_t *mctx, dns_name_t *target) {
|
||||
|
||||
|
Reference in New Issue
Block a user