mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-03-25 13:17:43 +00:00
Detect abbreviation collisions with multiple identities
This commit is contained in:
parent
7a2f1536bc
commit
7a3095de09
18
route_link.c
18
route_link.c
@ -1302,6 +1302,14 @@ int link_receive(struct internal_mdp_header *header, struct overlay_buffer *payl
|
||||
ack_mask,
|
||||
drop_rate);
|
||||
|
||||
if (transmitter && transmitter!=my_subscriber && transmitter->reachable==REACHABLE_SELF){
|
||||
// Our neighbour is talking about a path *from* a secondary SID of ours? Impossible.
|
||||
// Maybe we decoded an abbreviation incorrectly and this indicates a SID collision.
|
||||
// TODO add a test for this case!
|
||||
transmitter->send_full=1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (receiver == my_subscriber){
|
||||
// track if our neighbour is using us as an immediate neighbour, if they are we need to ack / nack promptly
|
||||
neighbour->using_us = (transmitter==header->source?1:0);
|
||||
@ -1310,6 +1318,16 @@ int link_receive(struct internal_mdp_header *header, struct overlay_buffer *payl
|
||||
// we can always send packets to ourself :)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (receiver->reachable == REACHABLE_SELF){
|
||||
if (transmitter && transmitter!=my_subscriber){
|
||||
// An alternative path to a secondary SID, that isn't via me? Impossible.
|
||||
// Maybe we decoded an abbreviation incorrectly and this indicates a SID collision.
|
||||
// TODO add a test for this case!
|
||||
receiver->send_full=1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
struct network_destination *destination=NULL;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user