diff options
-rw-r--r-- | contrib/ipfilter/ip_fil.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/contrib/ipfilter/ip_fil.c b/contrib/ipfilter/ip_fil.c index 208602a..9178bd3 100644 --- a/contrib/ipfilter/ip_fil.c +++ b/contrib/ipfilter/ip_fil.c @@ -228,7 +228,19 @@ ipf_setifpaddr(ifp, addr) sin6 = (struct sockaddr_in6 *)&ifa->ifa_addr; sin6->sin6_family = AF_INET6; - inet_pton(AF_INET6, addr, &sin6->sin6_addr); + /* Abort if bad address. */ + switch (inet_pton(AF_INET6, addr, &sin6->sin6_addr)) + { + case 1: + break; + case -1: + perror("inet_pton"); + abort(); + break; + default: + abort(); + break; + } } else #endif { |