mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-29 15:43:56 +00:00
Bring the interface down if sending broadcast packets fails for any reason
This commit is contained in:
parent
b916363b40
commit
d2a88b8b2d
@ -912,8 +912,9 @@ overlay_broadcast_ensemble(struct network_destination *destination,
|
|||||||
bytes, len, 0, (struct sockaddr *)&destination->address, sizeof(destination->address)) != len){
|
bytes, len, 0, (struct sockaddr *)&destination->address, sizeof(destination->address)) != len){
|
||||||
int e=errno;
|
int e=errno;
|
||||||
WHY_perror("sendto(c)");
|
WHY_perror("sendto(c)");
|
||||||
// only close the interface on some kinds of errors
|
// close the interface if we had any error while sending broadcast packets,
|
||||||
if (e==ENETDOWN || e==EINVAL)
|
// unicast packets should not bring the interface down
|
||||||
|
if (destination == interface->destination)
|
||||||
overlay_interface_close(interface);
|
overlay_interface_close(interface);
|
||||||
// TODO mark unicast destination as failed
|
// TODO mark unicast destination as failed
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user