out: free(ifc.ifc_buf); return err;
new(ife); strcpy(ife->name, ifr->ifr_name); add_interface(ife); } err = 0;  out: free(ifc.ifc_buf); return err;
static int if_readconf(void){	int numreqs = 30;	struct ifconf ifc;	struct ifreq *ifr; 	int n, err = -1;  	int skfd;	/* SIOCGIFCONF seems to only work properly on AF_INET sockets           currently */ 	skfd = get_socket_for_af(AF_INET); 	if (skfd < 0) { 		fprintf(stderr, _("warning: no inet socket available: %s\n"),				strerror(errno)); 		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(skfd, 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);  	return err;  }