|
|
|
@ -53,7 +53,7 @@ __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
|
|
|
|
|
struct ifconf ifc;
|
|
|
|
|
int rq_len;
|
|
|
|
|
int nifs;
|
|
|
|
|
# define RTQ_IFS 4
|
|
|
|
|
# define RQ_IFS 4
|
|
|
|
|
|
|
|
|
|
if (fd < 0)
|
|
|
|
|
fd = socket (AF_INET, SOCK_DGRAM, 0);
|
|
|
|
@ -74,13 +74,13 @@ __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
|
|
|
|
|
ifc.ifc_len = 0;
|
|
|
|
|
if (ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
|
|
|
|
|
{
|
|
|
|
|
rq_len = RTQ_IFS * sizeof (struct ifreq);
|
|
|
|
|
rq_len = RQ_IFS * sizeof (struct ifreq);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
rq_len = ifc.ifc_len;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
rq_len = RTQ_IFS * sizeof (struct ifreq);
|
|
|
|
|
rq_len = RQ_IFS * sizeof (struct ifreq);
|
|
|
|
|
|
|
|
|
|
/* Read all the interfaces out of the kernel. */
|
|
|
|
|
while (1)
|
|
|
|
|