summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rip6query
diff options
context:
space:
mode:
authorshin <shin@FreeBSD.org>1999-12-28 05:37:39 +0000
committershin <shin@FreeBSD.org>1999-12-28 05:37:39 +0000
commit21448b46272429cd4260638c31ec239118e6fb02 (patch)
tree3761183d74afd9038bbe0f1e1a64339ed76d2fcc /usr.sbin/rip6query
parent8b8214b6d3bce6e64a982ab67d5d17dfa3f85b0b (diff)
downloadFreeBSD-src-21448b46272429cd4260638c31ec239118e6fb02.zip
FreeBSD-src-21448b46272429cd4260638c31ec239118e6fb02.tar.gz
Small bug fix and improvements
(1)added error check of if_nameindex() return value at getaddrinfo(). (2)print out more detailed information when getaddrinfo() error value is EAI_SYSTEM.(in this case system error num is kept in errno) (1) is Discovered by: jinmei@kame.net in KAME environment.
Diffstat (limited to 'usr.sbin/rip6query')
-rw-r--r--usr.sbin/rip6query/rip6query.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/rip6query/rip6query.c b/usr.sbin/rip6query/rip6query.c
index 59e7932..6c2fb5c 100644
--- a/usr.sbin/rip6query/rip6query.c
+++ b/usr.sbin/rip6query/rip6query.c
@@ -119,7 +119,11 @@ main(argc, argv)
hints.ai_socktype = SOCK_STREAM;
error = getaddrinfo(argv[0], pbuf, &hints, &res);
if (error) {
- errx(1, "%s: %s", argv[0], gai_strerror(error));
+ fprintf(stderr, "rip6query: %s: %s\n", argv[0],
+ gai_strerror(error));
+ if (error == EAI_SYSTEM)
+ errx(1, "%s", strerror(errno));
+ exit(1);
/*NOTREACHED*/
}
if (res->ai_next) {
OpenPOWER on IntegriCloud