if no address is setted, do not call ioctl(SIOCAIFADDR)

Obtained from:	KAME
This commit is contained in:
Hajimu UMEMOTO 2001-02-21 18:15:18 +00:00
parent d5725e422d
commit bf8a1b099f

View File

@ -645,7 +645,7 @@ ifconfig(argc, argv, afp)
newaddr = 0;
}
}
if (newaddr) {
if (newaddr && setaddr) {
strncpy(afp->af_addreq, name, sizeof ifr.ifr_name);
if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0)
Perror("ioctl (SIOCAIFADDR)");