- if(ntohl(((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr.s_addr) == 0x7f000001)
- continue;
- if(ipv4 == NULL)
- {
- ipv4 = smalloc(sizeof(*ipv4));
- memcpy(ipv4, &ifr->ifr_addr, sizeof(ifr->ifr_addr));
- } else {
- free(ipv4);
- free(conf.ifc_buf);
- flog(LOG_WARNING, "could not locate an unambiguous interface for determining your public IP address - set net.publicif");
- errno = ENFILE; /* XXX: There's no appropriate one for this... */
- return(-1);
- }