diff options
author | Phil Blundell <philb@gnu.org> | 2000-10-28 11:04:00 +0000 |
---|---|---|
committer | Phil Blundell <philb@gnu.org> | 2000-10-28 11:04:00 +0000 |
commit | 5f76463b3ac502189918ad896935da29631d3d1b (patch) | |
tree | df123a694e768797e90e4458f24a036a51331a2d | |
parent | Always complain when SIOCGIFMAP fails. (diff) | |
download | net-tools-5f76463b3ac502189918ad896935da29631d3d1b.tar.gz net-tools-5f76463b3ac502189918ad896935da29631d3d1b.tar.bz2 net-tools-5f76463b3ac502189918ad896935da29631d3d1b.zip |
Handle getnameinfo() failures a bit better (should avoid segfault
when glibc is upgraded).
Bump version to 1.58 in preparation for new release.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | lib/inet6.c | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -101,7 +101,7 @@ endif # -------- end of user definitions -------- MAINTAINER = Philip.Blundell@pobox.com -RELEASE = 1.57 +RELEASE = 1.58 .EXPORT_ALL_VARIABLES: diff --git a/lib/inet6.c b/lib/inet6.c index 26e42c1..1f936b3 100644 --- a/lib/inet6.c +++ b/lib/inet6.c @@ -3,7 +3,7 @@ * support functions for the net-tools. * (most of it copied from lib/inet.c 1.26). * - * Version: $Id: inet6.c,v 1.9 1999/12/11 13:35:57 freitag Exp $ + * Version: $Id: inet6.c,v 1.10 2000/10/28 11:04:00 pb Exp $ * * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> * Copyright 1993 MicroWalt Corporation @@ -96,7 +96,7 @@ static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric) if ((s = getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6), name, 255 /* !! */ , NULL, 0, 0))) { - fprintf(stderr, "getnameinfo: %s\n", gai_strerror(s)); + fputs("getnameinfo failed\n", stderr); return -1; } return (0); @@ -128,7 +128,7 @@ static char *INET6_sprint(struct sockaddr *sap, int numeric) if (sap->sa_family == 0xFFFF || sap->sa_family == 0) return safe_strncpy(buff, _("[NONE SET]"), sizeof(buff)); if (INET6_rresolve(buff, (struct sockaddr_in6 *) sap, numeric) != 0) - return (NULL); + return safe_strncpy(buff, _("[UNKNOWN]"), sizeof(buff)); return (buff); } |