Replace overlay_render_sid() with alloca_tohex_sid()

To eliminate timebomb bugs caused by rotor wraparound
This commit is contained in:
Andrew Bettison 2012-07-03 17:59:30 +09:30
parent b1c78f9fa3
commit 2c87039307
15 changed files with 62 additions and 78 deletions

View File

@ -944,9 +944,7 @@ int app_mdp_ping(int argc, const char *const *argv, struct command_line_option *
}
/* XXX Eventually we should try to resolve SID to phone number and vice versa */
printf("MDP PING %s (%s): 12 data bytes\n",
overlay_render_sid(ping_sid),
overlay_render_sid(ping_sid));
printf("MDP PING %s (%s): 12 data bytes\n", alloca_tohex_sid(ping_sid), alloca_tohex_sid(ping_sid));
long long rx_mintime=-1;
long long rx_maxtime=-1;
@ -1000,7 +998,7 @@ int app_mdp_ping(int argc, const char *const *argv, struct command_line_option *
long long *txtime=(long long *)&mdp.in.payload[4];
long long delay=overlay_gettime_ms()-*txtime;
printf("%s: seq=%d time=%lld ms%s%s\n",
overlay_render_sid(mdp.in.src.sid),(*rxseq)-firstSeq+1,delay,
alloca_tohex_sid(mdp.in.src.sid),(*rxseq)-firstSeq+1,delay,
mdp.packetTypeAndFlags&MDP_NOCRYPT?"":" ENCRYPTED",
mdp.packetTypeAndFlags&MDP_NOSIGN?"":" SIGNED");
// TODO Put duplicate pong detection here so that stats work properly.
@ -1031,7 +1029,7 @@ int app_mdp_ping(int argc, const char *const *argv, struct command_line_option *
rx_stddev=sqrtf(rx_stddev);
/* XXX Report final statistics before going */
fprintf(stderr,"--- %s ping statistics ---\n",overlay_render_sid(ping_sid));
fprintf(stderr,"--- %s ping statistics ---\n", alloca_tohex_sid(ping_sid));
fprintf(stderr,"%lld packets transmitted, %lld packets received, %3.1f%% packet loss\n",
tx_count,rx_count,tx_count?(tx_count-rx_count)*100.0/tx_count:0);
fprintf(stderr,"round-trip min/avg/max/stddev%s = %lld/%.3f/%lld/%.3f ms\n",
@ -1559,7 +1557,7 @@ int app_keyring_list(int argc, const char *const *argv, struct command_line_opti
if (kp->type==KEYTYPE_DID) { did=kp->private_key; name=kp->public_key; }
}
if (sid||did) {
if (sid) cli_printf("%s",overlay_render_sid(sid));
if (sid) cli_printf("%s", alloca_tohex_sid(sid));
cli_delim(":");
if (did) cli_puts((char*)did);
cli_delim(":");
@ -1647,7 +1645,7 @@ int app_id_self(int argc, const char *const *argv, struct command_line_option *o
int i;
for(i=0;i<a.addrlist.frame_sid_count;i++) {
count++;
cli_printf("%s",overlay_render_sid(a.addrlist.sids[i])); cli_delim("\n");
cli_printf("%s", alloca_tohex_sid(a.addrlist.sids[i])); cli_delim("\n");
}
/* get ready to ask for next block of SIDs */
a.packetTypeAndFlags=MDP_GETADDRS;
@ -1801,7 +1799,7 @@ int app_node_info(int argc, const char *const *argv, struct command_line_option
// we might receive a late response from an ealier request, ignore it
if (memcmp(&m2.in.src.sid[0],&mdp.nodeinfo.sid[0],SID_SIZE)){
WHYF("Unexpected result from SID %s", overlay_render_sid(m2.in.src.sid));
WHYF("Unexpected result from SID %s", alloca_tohex_sid(m2.in.src.sid));
continue;
}
@ -1828,7 +1826,7 @@ int app_node_info(int argc, const char *const *argv, struct command_line_option
cli_printf("%d",mdp.nodeinfo.index); cli_delim(":");
cli_printf("%d",mdp.nodeinfo.count); cli_delim(":");
cli_printf("%s",mdp.nodeinfo.foundP?"found":"noresult"); cli_delim(":");
cli_printf("%s",overlay_render_sid(mdp.nodeinfo.sid)); cli_delim(":");
cli_printf("%s", alloca_tohex_sid(mdp.nodeinfo.sid)); cli_delim(":");
cli_printf("%s",mdp.nodeinfo.resolve_did?mdp.nodeinfo.did:"did-not-resolved");
cli_delim(":");
cli_printf("%s",mdp.nodeinfo.localP?"self":"peer"); cli_delim(":");

View File

@ -196,7 +196,7 @@ int stowDid(unsigned char *packet,int *ofs,char *did)
return 0;
}
int extractSid(unsigned char *packet, int *ofs,char *sid)
int extractSid(const unsigned char *packet, int *ofs, char *sid)
{
(void) tohex(sid, packet + *ofs, SID_SIZE);
*ofs += SID_SIZE;

View File

@ -166,7 +166,7 @@ dna_helper_enqueue(char *did, unsigned char *requestorSid) {
which will include the requestor's SID.
*/
bzero(buffer, sizeof(buffer));
if (snprintf(buffer, sizeof(buffer) - 1, "%s|%s|\n", overlay_render_sid(requestorSid), did) >
if (snprintf(buffer, sizeof(buffer) - 1, "%s|%s|\n", alloca_tohex_sid(requestorSid), did) >
sizeof(buffer) - 1)
return WHY("Command to helper is too long");

View File

@ -1200,8 +1200,8 @@ int keyring_mapping_request(keyring_file *k,overlay_mdp_frame *req)
DEBUG("Sent SID:SAS mapping mutual-signature");
printf("%d byte reply is from %s:%u\n to %s:%u\n",
req->out.payload_length,
overlay_render_sid(req->out.src.sid),req->out.src.port,
overlay_render_sid(req->out.dst.sid),req->out.dst.port);
alloca_tohex_sid(req->out.src.sid),req->out.src.port,
alloca_tohex_sid(req->out.dst.sid),req->out.dst.port);
return overlay_mdp_dispatch(req,1,NULL,0);
} else {
/* It's probably a response. */
@ -1254,8 +1254,8 @@ int keyring_mapping_request(keyring_file *k,overlay_mdp_frame *req)
crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES);
fprintf(stderr,"Mapping #%d (count=%d) SID=%s to SAS=%s*\n",i,
sid_sas_mapping_count,
overlay_render_sid(sid_sas_mappings[i].sid),
overlay_render_sid(sid_sas_mappings[i].sas_public));
alloca_tohex_sid(sid_sas_mappings[i].sid),
alloca_tohex_sid(sid_sas_mappings[i].sas_public));
sid_sas_mappings[i].validP=1;
sid_sas_mappings[i].last_request_time_in_ms=0;
DEBUG("Stored mapping");
@ -1302,7 +1302,7 @@ unsigned char *keyring_find_sas_public(keyring_file *k,unsigned char *sid)
record. */
break;
}
WHYF("Asking for SAS mapping for %s",overlay_render_sid(sid));
WHYF("Asking for SAS mapping for %s", alloca_tohex_sid(sid));
/* allocate mapping slot or replace one at random, depending on how full things
are */

View File

@ -389,10 +389,9 @@ int monitor_process_command(struct monitor_context *c)
for(bin=0;bin<overlay_bin_count;bin++)
for(slot=0;slot<overlay_bin_size;slot++)
{
if (!overlay_nodes[bin][slot].sid[0])
{
continue; }
strcpy(sid,overlay_render_sid(overlay_nodes[bin][slot].sid));
if (!overlay_nodes[bin][slot].sid[0])
continue;
tohex(sid, overlay_nodes[bin][slot].sid, SID_SIZE);
break;
}
}
@ -403,9 +402,8 @@ int monitor_process_command(struct monitor_context *c)
WRITE_STR(c->alarm.poll.fd,"\nERROR:no local identity, so cannot place call\n");
}
else {
bcopy(keyring->contexts[cn]->identities[in]
->keypairs[kp]->public_key,
&mdp.vompevent.local_sid[0],SID_SIZE);
bcopy(keyring->contexts[cn]->identities[in]->keypairs[kp]->public_key,
&mdp.vompevent.local_sid[0], SID_SIZE);
stowSid(&mdp.vompevent.remote_sid[0],0,sid);
vomp_mdp_event(&mdp,NULL,0);
}
@ -498,7 +496,7 @@ int monitor_announce_bundle(rhizome_manifest *m)
const char *recipient = rhizome_manifest_get(m, "recipient", NULL, 0);
snprintf(msg,1024,"\nBUNDLE:%s:%s:%lld:%lld:%s:%s:%s\n",
/* XXX bit of a hack here, since SIDs and cryptosign public keys have the same length */
overlay_render_sid(m->cryptoSignPublic),
alloca_tohex_sid(m->cryptoSignPublic),
service ? service : "",
m->version,
m->fileLength,
@ -542,8 +540,8 @@ int monitor_call_status(vomp_call_state *call)
call->local.session,call->remote.session,
call->local.state,call->remote.state,
call->fast_audio,
overlay_render_sid(call->local.sid),
overlay_render_sid(call->remote.sid),
alloca_tohex_sid(call->local.sid),
alloca_tohex_sid(call->remote.sid),
call->local.did,call->remote.did);
msg[1023]=0;
for(i=monitor_socket_count -1;i>=0;i--)
@ -568,7 +566,7 @@ int monitor_call_status(vomp_call_state *call)
int monitor_announce_peer(const unsigned char *sid)
{
char msg[1024];
int n = snprintf(msg, sizeof msg, "\nNEWPEER:%s\n",overlay_render_sid(sid));
int n = snprintf(msg, sizeof msg, "\nNEWPEER:%s\n", alloca_tohex_sid(sid));
monitor_tell_clients(msg, n, MONITOR_PEERS);
return 0;
}

View File

@ -316,7 +316,7 @@ int overlay_frame_process(struct overlay_interface *interface,overlay_frame *f)
if (0)
DEBUGF("considering forwarding frame to %s (forme=%d, bcast=%d, dup=%d)",
overlay_render_sid(f->destination),ultimatelyForMe,broadcast,
alloca_tohex_sid(f->destination),ultimatelyForMe,broadcast,
duplicateBroadcast);
if (overlay_address_is_broadcast(f->destination))
@ -332,9 +332,9 @@ int overlay_frame_process(struct overlay_interface *interface,overlay_frame *f)
if ((!sameAsNextHop)&&overlay_broadcast_drop_check(f->destination))
duplicateBroadcast=1;
if (duplicateBroadcast) {
DEBUGF("reject src is %s", overlay_render_sid(f->source));
DEBUGF("reject nexthop is %s", overlay_render_sid(f->nexthop));
DEBUGF("reject destination is %s", overlay_render_sid(f->destination));
DEBUGF("reject src is %s", alloca_tohex_sid(f->source));
DEBUGF("reject nexthop is %s", alloca_tohex_sid(f->nexthop));
DEBUGF("reject destination is %s", alloca_tohex_sid(f->destination));
RETURN(WHY("Not forwarding or reading duplicate broadcast"));
}
}
@ -390,9 +390,9 @@ int overlay_frame_process(struct overlay_interface *interface,overlay_frame *f)
case OF_TYPE_DATA_VOICE:
if (0) {
DEBUG("saw mdp containing frame");
DEBUGF(" src = %s\n",overlay_render_sid(f->source));
DEBUGF(" nxt = %s\n",overlay_render_sid(f->nexthop));
DEBUGF(" dst = %s\n",overlay_render_sid(f->destination));
DEBUGF(" src = %s\n", alloca_tohex_sid(f->source));
DEBUGF(" nxt = %s\n", alloca_tohex_sid(f->nexthop));
DEBUGF(" dst = %s\n", alloca_tohex_sid(f->destination));
dump("payload", f->payload->bytes, f->payload->length);
}
overlay_saw_mdp_containing_frame(f,now);

View File

@ -230,7 +230,7 @@ int overlay_abbreviate_append_address(overlay_buffer *b,unsigned char *a)
int r=overlay_abbreviate_address(a,&b->bytes[b->length],&count);
if (debug&DEBUG_PACKETCONSTRUCTION) {
fprintf(stderr,"address %s abbreviates as shown in this ",
overlay_render_sid(a));
alloca_tohex_sid(a));
dump(NULL,&b->bytes[b->length],count);
}
if (r) return r;
@ -553,7 +553,7 @@ int overlay_abbreviate_set_most_recent_address(unsigned char *in)
{
bcopy(in,&overlay_abbreviate_previous_address.b[0],SID_SIZE);
if (debug&DEBUG_OVERLAYABBREVIATIONS) fprintf(stderr,"Most recent address=%s\n",
overlay_render_sid(in));
alloca_tohex_sid(in));
return 0;
}

View File

@ -186,7 +186,7 @@ int overlay_route_saw_advertisements(int i,overlay_frame *f, long long now)
}
int sender_score=sender->best_link_score;
if (debug&DEBUG_OVERLAYROUTEMONITOR)
DEBUGF("score to reach %s is %d", overlay_render_sid(f->source),sender_score);
DEBUGF("score to reach %s is %d", alloca_tohex_sid(f->source),sender_score);
while(ofs<f->payload->length)
{

View File

@ -725,7 +725,7 @@ int overlay_stuff_packet_from_queue(int i,overlay_buffer *e,int q,long long now,
}
} else {
DEBUG("bummer, I couldn't find an open route to that node");
DEBUGF("sid=%s",overlay_render_sid((*p)->destination));
DEBUGF("sid=%s", alloca_tohex_sid((*p)->destination));
}
} else if (!(*p)->broadcast_sent_via[i])
{

View File

@ -325,7 +325,7 @@ unsigned char *overlay_mdp_decrypt(overlay_frame *f,overlay_mdp_frame *mdp,
if (0) {
fflush(stderr);
printf("crypted MDP frame for %s\n",
overlay_render_sid(mdp->out.dst.sid));
alloca_tohex_sid(mdp->out.dst.sid));
fflush(stdout);
}
@ -542,8 +542,8 @@ int overlay_saw_mdp_frame(overlay_mdp_frame *mdp,long long now)
bcopy(packedSid,&mdpreply.out.src.sid[0],SID_SIZE);
/* and build reply as did\nname\nURI<NUL> */
snprintf((char *)&mdpreply.out.payload[0],512,"%s|sid://%s/%s|%s|%s|",
overlay_render_sid(packedSid),
overlay_render_sid(packedSid),unpackedDid,
alloca_tohex_sid(packedSid),
alloca_tohex_sid(packedSid),unpackedDid,
unpackedDid,name);
mdpreply.out.payload_length=strlen((char *)mdpreply.out.payload)+1;
@ -682,7 +682,7 @@ int overlay_mdp_sanitytest_sourceaddr(sockaddr_mdp *src,int userGeneratedFrameP,
}
printf("addr=%s port=%u (0x%x)\n",
overlay_render_sid(src->sid),src->port,src->port);
alloca_tohex_sid(src->sid),src->port,src->port);
if (recvaddr) printf("recvaddr='%s'\n",
recvaddr->sun_path);
return WHY("No such socket binding:unix domain socket tuple exists -- someone might be trying to spoof someone else's connection");
@ -1330,7 +1330,7 @@ int overlay_mdp_getmyaddr(int index,unsigned char *sid)
}
if ((a.packetTypeAndFlags&MDP_TYPE_MASK)!=MDP_ADDRLIST)
return WHY("MDP Server returned something other than an address list");
if (0) DEBUGF("local addr 0 = %s",overlay_render_sid(a.addrlist.sids[0]));
if (0) DEBUGF("local addr 0 = %s",alloca_tohex_sid(a.addrlist.sids[0]));
bcopy(&a.addrlist.sids[0][0],sid,SID_SIZE);
return 0;
}

View File

@ -180,7 +180,7 @@ int packetOkOverlay(struct overlay_interface *interface,unsigned char *packet, s
f.nexthop_address_status=overlay_abbreviate_expand_address(packet,&offset,f.nexthop,&alen);
if (debug&DEBUG_PACKETFORMATS) {
if (f.nexthop_address_status==OA_RESOLVED)
DEBUGF("next hop address is %s", overlay_render_sid(f.nexthop));
DEBUGF("next hop address is %s", alloca_tohex_sid(f.nexthop));
}
/* Now just make the rest of the frame available via the received frame structure, as the

View File

@ -82,7 +82,7 @@ int overlay_frame_package_fmt1(overlay_frame *p,overlay_buffer *b)
if (p->nexthop_address_status!=OA_RESOLVED) {
if (0) WHYF("next hop is NOT resolved for packet to %s",
overlay_render_sid(p->destination));
alloca_tohex_sid(p->destination));
if (overlay_address_is_broadcast(p->destination)) {
/* Broadcast frames are broadcast rather than unicast to next hop.
Just check if the broadcast frame should be dropped first. */
@ -101,7 +101,7 @@ int overlay_frame_package_fmt1(overlay_frame *p,overlay_buffer *b)
}
} else {
if (0) WHYF("next hop IS resolved for packet to %s",
overlay_render_sid(p->destination));
alloca_tohex_sid(p->destination));
}
@ -223,10 +223,10 @@ int dump_payload(overlay_frame *p,char *message)
fflush(stdout);
fprintf(stderr,
"+++++\nFrame from %s to %s of type 0x%02x %s:\n",
overlay_render_sid(p->source),
overlay_render_sid(p->destination),p->type,
alloca_tohex_sid(p->source),
alloca_tohex_sid(p->destination),p->type,
message?message:"");
fprintf(stderr," next hop is %s\n",overlay_render_sid(p->nexthop));
fprintf(stderr," next hop is %s\n",alloca_tohex_sid(p->nexthop));
fflush(stderr);
if (p->payload) dump("payload contents",
&p->payload->bytes[0],p->payload->length);

View File

@ -395,11 +395,11 @@ int overlay_get_nexthop(unsigned char *d,unsigned char *nexthop,int *nexthoplen,
if (neh->scores[*interface]<1) {
if (debug&DEBUG_OVERLAYROUTING) {
*interface=-1;
DEBUGF("No open path to %s",overlay_render_sid(neh->node->sid));
DEBUGF("No open path to %s",alloca_tohex_sid(neh->node->sid));
}
return -1;
}
if (0) DEBUGF("nexthop is %s",overlay_render_sid(nexthop));
if (0) DEBUGF("nexthop is %s",alloca_tohex_sid(nexthop));
return 0;
} else {
/* Is not a direct neighbour.
@ -428,10 +428,10 @@ int overlay_get_nexthop(unsigned char *d,unsigned char *nexthop,int *nexthoplen,
if (best_o>-1) {
return 0;
} else {
return -1; // WHYF("No open path to %s",overlay_render_sid(d));
return -1; // WHYF("No open path to %s",alloca_tohex_sid(d));
}
} else {
return -1; // WHYF("No open path to %s",overlay_render_sid(d));
return -1; // WHYF("No open path to %s",alloca_tohex_sid(d));
}
}
}
@ -704,7 +704,7 @@ int overlay_route_i_can_hear_node(unsigned char *who,int sender_interface,
long long now)
{
if (0) DEBUGF("I can hear node %s (but I really only care who can hear me)",
overlay_render_sid(who));
alloca_tohex_sid(who));
return 0;
}
@ -1010,17 +1010,8 @@ int overlay_route_recalc_neighbour_metrics(overlay_neighbour *n,long long now)
int ors_rotor=0;
char ors_out[4][SID_STRLEN+1];
char *overlay_render_sid(unsigned char *sid)
{
int zero=0;
ors_rotor++;
ors_rotor&=3;
extractSid(sid,&zero,ors_out[ors_rotor]);
ors_out[ors_rotor][SID_STRLEN] = '\0';
return ors_out[ors_rotor];
}
char *overlay_render_sid_prefix(unsigned char *sid,int l)
char *overlay_render_sid_prefix(const unsigned char *sid,int l)
{
int zero=0;
@ -1074,7 +1065,7 @@ int overlay_route_saw_selfannounce_ack(overlay_frame *f,long long now)
if (f->source_address_status==OA_RESOLVED&&
f->destination_address_status==OA_RESOLVED) {
if (0) DEBUGF("f->source=%s, f->destination=%s",
overlay_render_sid(f->source),overlay_render_sid(f->destination));
alloca_tohex_sid(f->source),alloca_tohex_sid(f->destination));
overlay_route_record_link(now,f->source,f->source,iface,s1,s2,
0 /* no associated score */,
0 /* no gateways in between */);
@ -1093,7 +1084,7 @@ int overlay_route_record_link(long long now,unsigned char *to,
int i,slot=-1;
if (0) DEBUGF("to=%s, via=%s, iface=%d, s1=%d, s2=%d",
overlay_render_sid(to),overlay_render_sid(via),
alloca_tohex_sid(to),alloca_tohex_sid(via),
sender_interface,s1,s2);
@ -1102,16 +1093,16 @@ int overlay_route_record_link(long long now,unsigned char *to,
/* Don't record routes to ourselves */
if (overlay_address_is_local(to)) {
if (0) DEBUGF("Ignoring self announce ack addressed to me (%s).",
overlay_render_sid(to));
alloca_tohex_sid(to));
return 0;
}
else if (0) DEBUGF("Recording link to %s",overlay_render_sid(to));
else if (0) DEBUGF("Recording link to %s",alloca_tohex_sid(to));
for(i=0;i<SID_SIZE;i++) if (to[i]!=via[i]) break;
if (i==SID_SIZE)
{
/* It's a neighbour observation */
if (0) DEBUGF("%s is my neighbour",overlay_render_sid(to));
if (0) DEBUGF("%s is my neighbour",alloca_tohex_sid(to));
overlay_route_node_can_hear_me(to,sender_interface,s1,s2,now);
}

View File

@ -724,7 +724,7 @@ int packageVariableSegment(unsigned char *data,int *dlen,
int packetDecipher(unsigned char *packet,int len,int cipher);
int safeZeroField(unsigned char *packet,int start,int count);
int unpackageVariableSegment(unsigned char *data,int dlen,int flags,struct response *r);
int extractSid(unsigned char *packet,int *ofs,char *sid);
int extractSid(const unsigned char *packet,int *ofs, char *sid);
int hlrSetVariable(unsigned char *hlr,int hofs,int varid,int varinstance,
unsigned char *value,int len);
int extractDid(unsigned char *packet,int *ofs,char *did);
@ -1045,7 +1045,6 @@ long long overlay_time_in_ms();
int overlay_abbreviate_lookup_sender_id();
int ob_dump(overlay_buffer *b,char *desc);
unsigned int ob_get_int(overlay_buffer *b,int offset);
char *overlay_render_sid(unsigned char *sid);
int overlay_route_record_link(long long now,unsigned char *to,
unsigned char *via,int sender_interface,
unsigned int s1,unsigned int s2,int score,int gateways_en_route);
@ -1344,8 +1343,7 @@ int overlay_mdp_dispatch(overlay_mdp_frame *mdp,int userGeneratedFrameP,
int ob_bcopy(overlay_buffer *b,int from, int to, int len);
int ob_setbyte(overlay_buffer *b,int ofs,unsigned char value);
char *overlay_render_sid(unsigned char *sid);
char *overlay_render_sid_prefix(unsigned char *sid,int l);
char *overlay_render_sid_prefix(const unsigned char *sid,int l);
int dump_payload(overlay_frame *p,char *message);
int urandombytes(unsigned char *x,unsigned long long xlen);

9
vomp.c
View File

@ -1072,9 +1072,9 @@ int dump_vomp_status()
for(i=0;i<vomp_call_count;i++)
{
printf("%s/%06x\n-> %s/%06x\n (%s -> %s)\n",
overlay_render_sid(vomp_call_states[i].local.sid),
alloca_tohex_sid(vomp_call_states[i].local.sid),
vomp_call_states[i].local.session,
overlay_render_sid(vomp_call_states[i].remote.sid),
alloca_tohex_sid(vomp_call_states[i].remote.sid),
vomp_call_states[i].remote.session,
vomp_call_states[i].local.did,
vomp_call_states[i].remote.did);
@ -1231,9 +1231,8 @@ int app_vomp_dial(int argc, const char *const *argv, struct command_line_option
mdp.vompevent.flags=VOMPEVENT_DIAL;
if (overlay_mdp_getmyaddr(0,&mdp.vompevent.local_sid[0])) return -1;
stowSid(&mdp.vompevent.remote_sid[0],0,sid);
printf("local_sid=%s\n",overlay_render_sid(mdp.vompevent.local_sid));
printf("remote_sid=%s from %s\n",
overlay_render_sid(mdp.vompevent.remote_sid),sid);
printf("local_sid=%s\n",alloca_tohex_sid(mdp.vompevent.local_sid));
printf("remote_sid=%s from %s\n", alloca_tohex_sid(mdp.vompevent.remote_sid),sid);
if (overlay_mdp_send(&mdp,MDP_AWAITREPLY,5000))
{