Skip nd6 line with no warning message when the system does not support

INET6.

Spotted by:	flo
This commit is contained in:
hrs 2012-05-11 20:01:45 +00:00
parent e154175378
commit 39c22309ed

View File

@ -148,11 +148,13 @@ nd6_status(int s)
memset(&nd, 0, sizeof(nd));
strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname));
if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
if (errno != EPROTONOSUPPORT)
warn("socket(AF_INET6, SOCK_DGRAM)");
return;
}
error = ioctl(s6, SIOCGIFINFO_IN6, &nd);
if (error) {
if (errno != EPFNOSUPPORT)
warn("ioctl(SIOCGIFINFO_IN6)");
close(s6);
return;