Commit 75e1c0cd authored by Mike Hibler's avatar Mike Hibler
Browse files

correctly set length of IFCONF ioctl

parent 87fef2c3
...@@ -445,7 +445,7 @@ int main (int argc, char **argv) { ...@@ -445,7 +445,7 @@ int main (int argc, char **argv) {
* are up in response to SIOCGIFCONF * are up in response to SIOCGIFCONF
*/ */
ifc.ifc_buf = malloc(MAX_INTERFACES * 100 * sizeof (struct ifreq)); ifc.ifc_buf = malloc(MAX_INTERFACES * 100 * sizeof (struct ifreq));
ifc.ifc_len = MAX_INTERFACES * 100; ifc.ifc_len = MAX_INTERFACES * 100 * sizeof (struct ifreq);
if (ioctl(sock,SIOCGIFCONF,&ifc) < 0) { if (ioctl(sock,SIOCGIFCONF,&ifc) < 0) {
perror("SIOCGIFCONF"); perror("SIOCGIFCONF");
exit(1); exit(1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment