other bug fixes and cleanups for "dna lookup"

This commit is contained in:
gardners 2012-05-18 12:55:56 +09:30
parent 4ddb7a5572
commit c9a58937ca
3 changed files with 7 additions and 4 deletions

View File

@ -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();

View File

@ -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. */

View File

@ -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");