mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-14 06:06:44 +00:00
Don't close everything when we get an error response
This commit is contained in:
parent
c1fc33542d
commit
f5aef9998d
@ -781,8 +781,7 @@ static int process_packet(int mdp_sock, struct mdp_header *header, const uint8_t
|
||||
{
|
||||
// any kind of error reported by the daemon, close all related msp connections on this mdp socket
|
||||
if (header->flags & MDP_FLAG_ERROR){
|
||||
WHY("Error returned from daemon");
|
||||
msp_close_all(mdp_sock);
|
||||
WHY("Error returned from daemon!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -852,6 +851,7 @@ static int process_packet(int mdp_sock, struct mdp_header *header, const uint8_t
|
||||
uint8_t response = FLAG_STOP;
|
||||
// we don't have a matching socket, reply with STOP flag to force breaking the connection
|
||||
// TODO global rate limit?
|
||||
// Note that we might recieve a queued packet after sending a MDP_FLAG_CLOSE, so this might trigger an error
|
||||
mdp_send(mdp_sock, header, &response, 1);
|
||||
if (config.debug.msp)
|
||||
DEBUGF("Replying to unexpected packet with STOP packet");
|
||||
|
Loading…
x
Reference in New Issue
Block a user