mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-20 17:33:08 +00:00
other bug fixes and cleanups for "dna lookup"
This commit is contained in:
parent
4ddb7a5572
commit
c9a58937ca
@ -441,12 +441,11 @@ int app_dna_lookup(int argc, const char *const *argv, struct command_line_option
|
||||
overlay_mdp_frame mdp;
|
||||
bzero(&mdp,sizeof(mdp));
|
||||
|
||||
WHY("polling network");
|
||||
|
||||
/* Now repeatedly send resolution request and collect results until we reach
|
||||
timeout. */
|
||||
unsigned long long timeout=overlay_gettime_ms()+3000;
|
||||
unsigned long long last_tx=0;
|
||||
|
||||
while(timeout>overlay_gettime_ms())
|
||||
{
|
||||
unsigned long long now=overlay_gettime_ms();
|
||||
|
@ -1070,8 +1070,8 @@ int overlay_mdp_relevant_bytes(overlay_mdp_frame *mdp)
|
||||
/* This formulation is used so that we don't copy any bytes after the
|
||||
end of the string, to avoid information leaks */
|
||||
len=&mdp->error.message[0]-(char *)mdp;
|
||||
len+=strlen(mdp->error.message)+1;
|
||||
WHYF("error mdp frame is %d bytes",len);
|
||||
len+=strlen(mdp->error.message)+1;
|
||||
WHYF("mdp return/error code: %d:%s",mdp->error.error,mdp->error.message);
|
||||
break;
|
||||
case MDP_VOMPEVENT:
|
||||
/* XXX too hard to work out precisely for now. */
|
||||
|
@ -368,6 +368,10 @@ int overlay_get_nexthop(unsigned char *d,unsigned char *nexthop,int *nexthoplen,
|
||||
int i;
|
||||
|
||||
if (overlay_broadcast_drop_check(d)) return WHY("I have sent that broadcast frame before");
|
||||
if (overlay_address_is_broadcast(d)) {
|
||||
bcopy(&d[0],&nexthop[0],SID_SIZE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!overlay_neighbours) return WHY("I have no neighbours");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user