mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-19 13:17:56 +00:00
Fix issue #23, regression in 'id' command
This commit is contained in:
parent
164e9a7b87
commit
c47e99d097
@ -1344,7 +1344,7 @@ int app_id_self(int argc, const char *const *argv, struct command_line_option *o
|
||||
return WHYF("unsupported arg '%s'", argv[1]);
|
||||
a.addrlist.first_sid=0;
|
||||
|
||||
while(a.addrlist.frame_sid_count==MDP_MAX_SID_REQUEST) {
|
||||
do{
|
||||
result=overlay_mdp_send(&a,MDP_AWAITREPLY,5000);
|
||||
if (result) {
|
||||
if (a.packetTypeAndFlags==MDP_ERROR)
|
||||
@ -1366,7 +1366,8 @@ int app_id_self(int argc, const char *const *argv, struct command_line_option *o
|
||||
/* get ready to ask for next block of SIDs */
|
||||
a.packetTypeAndFlags=MDP_GETADDRS;
|
||||
a.addrlist.first_sid=a.addrlist.last_sid+1;
|
||||
}
|
||||
}while(a.addrlist.frame_sid_count==MDP_MAX_SID_REQUEST);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -951,7 +951,7 @@ static int search_subscribers(struct subscriber *subscriber, void *context){
|
||||
}
|
||||
|
||||
if (response->server_sid_count++ >= response->first_sid &&
|
||||
response->first_sid + response->frame_sid_count < response->last_sid) {
|
||||
response->frame_sid_count < MDP_MAX_SID_REQUEST) {
|
||||
memcpy(response->sids[response->frame_sid_count++], subscriber->sid, SID_SIZE);
|
||||
}
|
||||
|
||||
@ -1026,6 +1026,7 @@ void overlay_mdp_poll(struct sched_ent *alarm)
|
||||
case MDP_GETADDRS:
|
||||
{
|
||||
overlay_mdp_frame mdpreply;
|
||||
bzero(&mdpreply, sizeof(overlay_mdp_frame));
|
||||
mdpreply.packetTypeAndFlags = MDP_ADDRLIST;
|
||||
if (!overlay_mdp_address_list(&mdp->addrlist, &mdpreply.addrlist))
|
||||
/* Send back to caller */
|
||||
|
Loading…
Reference in New Issue
Block a user