if (ioctl(sk, SIOCGIFCONF, &ifc) < 0) {
if (ioctl(skfd, SIOCGIFCONF, &ifc) < 0) {
static int if_readconf(void){	int numreqs = 30;	struct ifconf ifc;	struct ifreq *ifr; 	int n, err = -1;  	int sk; 	sk = socket(PF_INET, SOCK_DGRAM, 0); 	if (sk < 0) { 		perror(_("error opening inet socket"));		return -1; 	}	ifc.ifc_buf = NULL;	for (;;) { 		ifc.ifc_len = sizeof(struct ifreq) * numreqs; 		ifc.ifc_buf = xrealloc(ifc.ifc_buf, ifc.ifc_len); 				if (ioctl(sk, SIOCGIFCONF, &ifc) < 0) { 			perror("SIOCGIFCONF");			goto out; 		}				if (ifc.ifc_len == sizeof(struct ifreq)*numreqs) {			/* assume it overflowed and try again */ 			numreqs += 10; 			continue;		}		break; 	}	for (ifr = ifc.ifc_req,n = 0; n < ifc.ifc_len; 		 n += sizeof(struct ifreq), ifr++) {		struct interface *ife;				ife = lookup_interface(ifr->ifr_name);		if (ife) 			continue; 				new(ife); 		strcpy(ife->name, ifr->ifr_name);		add_interface(ife); 	}	err = 0; out:	free(ifc.ifc_buf);  	close(sk);	return err;  }