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

correctly set length of IFCONF ioctl

parent 87fef2c3
......@@ -445,7 +445,7 @@ int main (int argc, char **argv) {
* are up in response to SIOCGIFCONF
*/
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) {
perror("SIOCGIFCONF");
exit(1);
......
Markdown is supported
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