diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2016-09-19 07:08:02 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2016-09-19 07:08:02 +0000 |
commit | 8e08fd4be281d3cc3cb7ee56e9351e5edfcc51c1 (patch) | |
tree | d091d1dcda84022131c6a192f7f0d683d28c374f /usr.sbin | |
parent | fcb46c4365c40831220993f10e09b4acccea5eec (diff) |
Only allow standard dot notation for IPv4 addresses as target.
We can get rid of inet_aton(3) and use the AF independent getaddrinfo(3).
OK natano@, krw@, millert@, claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/traceroute/traceroute.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/usr.sbin/traceroute/traceroute.c b/usr.sbin/traceroute/traceroute.c index b58f68a2e5e..5c53f539f61 100644 --- a/usr.sbin/traceroute/traceroute.c +++ b/usr.sbin/traceroute/traceroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: traceroute.c,v 1.146 2016/09/03 22:00:06 benno Exp $ */ +/* $OpenBSD: traceroute.c,v 1.147 2016/09/19 07:08:01 florian Exp $ */ /* $NetBSD: traceroute.c,v 1.10 1995/05/21 15:50:45 mycroft Exp $ */ /* @@ -543,12 +543,7 @@ main(int argc, char *argv[]) memset(&to4, 0, sizeof(to4)); memset(&to6, 0, sizeof(to6)); - if (inet_aton(*argv, &to4.sin_addr) != 0) { - hostname = *argv; - if ((dest = strdup(inet_ntoa(to4.sin_addr))) == NULL) - errx(1, "malloc"); - } else - dest = *argv; + dest = *argv; memset(&hints, 0, sizeof(hints)); hints.ai_family = v6flag ? PF_INET6 : PF_INET; |