summaryrefslogtreecommitdiff
path: root/extra/resolveip.c
diff options
context:
space:
mode:
Diffstat (limited to 'extra/resolveip.c')
-rw-r--r--extra/resolveip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/extra/resolveip.c b/extra/resolveip.c
index b61c0871aaf..e5fede7fda8 100644
--- a/extra/resolveip.c
+++ b/extra/resolveip.c
@@ -116,11 +116,13 @@ int main(int argc, char **argv)
while (argc--)
{
+ struct in_addr addr;
ip = *argv++;
- if (my_isdigit(&my_charset_latin1,ip[0]))
+ /* Not compatible with IPv6! Probably should use getnameinfo(). */
+ if (inet_aton(ip, &addr) != 0)
{
- taddr = inet_addr(ip);
+ taddr= addr.s_addr;
if (taddr == htonl(INADDR_BROADCAST))
{
puts("Broadcast");