Check return code from inet_pton.
Discovered by: Coverity. Approved by: glebius (mentor) Approved by: re (blanket)
This commit is contained in:
parent
2859ca23da
commit
8464e56e2a
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user