mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-03-11 06:53:54 +00:00
fixed bug on android with previous commit
This commit is contained in:
parent
82ca3dde5d
commit
6e933be9ec
6
lsif.c
6
lsif.c
@ -74,7 +74,7 @@ int lsif(void)
|
|||||||
/* Get a socket handle. */
|
/* Get a socket handle. */
|
||||||
sck = socket(PF_INET, SOCK_DGRAM, 0);
|
sck = socket(PF_INET, SOCK_DGRAM, 0);
|
||||||
if(sck < 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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,14 +82,14 @@ int lsif(void)
|
|||||||
ifc.ifc_len = sizeof(buf);
|
ifc.ifc_len = sizeof(buf);
|
||||||
ifc.ifc_buf = buf;
|
ifc.ifc_buf = buf;
|
||||||
if(ioctl(sck, SIOCGIFCONF, &ifc) < 0) {
|
if(ioctl(sck, SIOCGIFCONF, &ifc) < 0) {
|
||||||
WHY("Failed to read interface list");
|
fprintf(stderr,"Failed to read interface list\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Iterate through the list of interfaces. */
|
/* Iterate through the list of interfaces. */
|
||||||
ifr = ifc.ifc_req;
|
ifr = ifc.ifc_req;
|
||||||
nInterfaces = ifc.ifc_len / sizeof(struct ifreq);
|
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++) {
|
for(i = 0; i < nInterfaces; i++) {
|
||||||
item = &ifr[i];
|
item = &ifr[i];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user