mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-07 11:08:36 +00:00
Android JNI/NDK build bug fixes suggested by Kris.
This commit is contained in:
parent
7c4f07279b
commit
7947485705
@ -173,7 +173,7 @@ int overlay_abbreviate_cache_address(unsigned char *sid)
|
||||
int index=((sid[0]<<16)|(sid[0]<<8)|sid[2])>>cache->shift;
|
||||
|
||||
/* Does the stored address match the one we have been passed? */
|
||||
if (!bcmp(sid,&cache->sids[index].b[0],SID_SIZE))
|
||||
if (!memcmp(sid,&cache->sids[index].b[0],SID_SIZE))
|
||||
/* Address is already in cache, so return and let the caller know. */
|
||||
return 1;
|
||||
|
||||
@ -191,7 +191,7 @@ int overlay_abbreviate_cache_address(unsigned char *sid)
|
||||
|
||||
int overlay_abbreviate_try_byindex(unsigned char *in,unsigned char *out,int *ofs,int index)
|
||||
{
|
||||
if(!bcmp(in,abbrs->sids[index],SID_SIZE))
|
||||
if(!memcmp(in,abbrs->sids[index],SID_SIZE))
|
||||
{
|
||||
/* We can encode this address with one byte */
|
||||
out[(*ofs)++]=0x01;
|
||||
@ -370,7 +370,7 @@ int overlay_abbreviate_cache_lookup(unsigned char *in,unsigned char *out,int *of
|
||||
fprintf(stderr,"*\n");
|
||||
|
||||
/* So is it there? */
|
||||
if (bcmp(in,&cache->sids[index].b[0],prefix_bytes))
|
||||
if (memcmp(in,&cache->sids[index].b[0],prefix_bytes))
|
||||
{
|
||||
/* No, it isn't in the cache. */
|
||||
return OA_PLEASEEXPLAIN;
|
||||
|
@ -190,7 +190,7 @@ int overlay_interface_init_socket(int interface,struct sockaddr_in src_addr,stru
|
||||
}
|
||||
|
||||
return 0;
|
||||
#undef I(X)
|
||||
#undef I
|
||||
}
|
||||
|
||||
int overlay_interface_init(char *name,struct sockaddr_in src_addr,struct sockaddr_in broadcast,
|
||||
@ -235,7 +235,7 @@ int overlay_interface_init(char *name,struct sockaddr_in src_addr,struct sockadd
|
||||
}
|
||||
|
||||
overlay_interface_count++;
|
||||
#undef I(X)
|
||||
#undef I
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -467,8 +467,8 @@ int overlay_interface_discover()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
freeifaddrs(ifaddr);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ overlay_node *overlay_route_find_node(unsigned char *sid,int createP)
|
||||
if (bin_number<0) { WHY("negative bin number"); return NULL; }
|
||||
|
||||
for(slot=0;slot<overlay_bin_size;slot++)
|
||||
if (!bcmp(sid,overlay_nodes[bin_number][slot].sid,SID_SIZE))
|
||||
if (!memcmp(sid,overlay_nodes[bin_number][slot].sid,SID_SIZE))
|
||||
{
|
||||
/* Found it */
|
||||
return &overlay_nodes[bin_number][slot];
|
||||
|
Loading…
x
Reference in New Issue
Block a user