}
-/** Parse an IPv4 address or IPv4 prefix in presentation format (and others)
+/**
+ * Parse an IPv4 address, IPv4 prefix in presentation format (and others), or
+ * a hostname.
*
* @param out Where to write the ip address value.
- * @param value to parse, may be dotted quad [+ prefix], or integer, or octal number, or '*' (INADDR_ANY).
+ * @param value to parse, may be dotted quad [+ prefix], or integer, or octal number, or '*' (INADDR_ANY), or a hostname.
* @param inlen Length of value, if value is \0 terminated inlen may be -1.
* @param resolve If true and value doesn't look like an IP address, try and resolve value as a hostname.
* @param fallback to IPv6 resolution if no A records can be found.
unsigned int mask;
char *eptr;
- /* Dotted quad + / + [0-9]{1,2} */
- char buffer[INET_ADDRSTRLEN + 3];
+ /* Dotted quad + / + [0-9]{1,2} or a hostname (RFC1035 2.3.4 Size limits) */
+ char buffer[256];
/*
* Copy to intermediary buffer if we were given a length
return 0;
}
-/** Parse an IPv6 address or IPv6 prefix in presentation format (and others)
+/**
+ * Parse an IPv6 address or IPv6 prefix in presentation format (and others),
+ * or a hostname.
*
* @param out Where to write the ip address value.
* @param value to parse.
unsigned int prefix;
char *eptr;
- /* IPv6 + / + [0-9]{1,3} */
- char buffer[INET6_ADDRSTRLEN + 4];
+ /* IPv6 + / + [0-9]{1,3} or a hostname (RFC1035 2.3.4 Size limits) */
+ char buffer[256];
/*
* Copy to intermediary buffer if we were given a length