mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-21 06:03:12 +00:00
fixed bug on android with previous commit
This commit is contained in:
parent
82ca3dde5d
commit
6e933be9ec
8
lsif.c
8
lsif.c
@ -25,7 +25,7 @@
|
||||
* http://teotwawki.steubentech.com/
|
||||
*
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -74,7 +74,7 @@ int lsif(void)
|
||||
/* Get a socket handle. */
|
||||
sck = socket(PF_INET, SOCK_DGRAM, 0);
|
||||
if(sck < 0) {
|
||||
WHY("Failed to gt socket handle to list addresses");
|
||||
fprintf(stderr,"Failed to gt socket handle to list addresses\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -82,14 +82,14 @@ int lsif(void)
|
||||
ifc.ifc_len = sizeof(buf);
|
||||
ifc.ifc_buf = buf;
|
||||
if(ioctl(sck, SIOCGIFCONF, &ifc) < 0) {
|
||||
WHY("Failed to read interface list");
|
||||
fprintf(stderr,"Failed to read interface list\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Iterate through the list of interfaces. */
|
||||
ifr = ifc.ifc_req;
|
||||
nInterfaces = ifc.ifc_len / sizeof(struct ifreq);
|
||||
WHYF("Examining %d interfaces",nInterfaces);
|
||||
fprintf(stderr,"Examining %d interfaces\n",nInterfaces);
|
||||
for(i = 0; i < nInterfaces; i++) {
|
||||
item = &ifr[i];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user