mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-06 19:19:16 +00:00
Probe unicast links created from incoming packets
This commit is contained in:
parent
d65608720b
commit
25ed16178b
@ -153,7 +153,8 @@ static void parse_frame(struct overlay_buffer *buff){
|
|||||||
context.sender->address.sin_port = htons(interface->port);
|
context.sender->address.sin_port = htons(interface->port);
|
||||||
|
|
||||||
if (context.sender->reachable==REACHABLE_NONE){
|
if (context.sender->reachable==REACHABLE_NONE){
|
||||||
reachable_unicast(context.sender, interface, *addr, interface->port);
|
set_reachable(context.sender, REACHABLE_UNICAST|REACHABLE_ASSUMED);
|
||||||
|
overlay_send_probe(context.sender, context.sender->address, interface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,9 +214,12 @@ int packetOkOverlay(struct overlay_interface *interface,unsigned char *packet, s
|
|||||||
RETURN(0);
|
RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context.sender->last_rx = now;
|
||||||
|
|
||||||
|
// TODO probe unicast links when we detect an address change.
|
||||||
|
|
||||||
// always update the IP address we heard them from, even if we don't need to use it right now
|
// always update the IP address we heard them from, even if we don't need to use it right now
|
||||||
context.sender->address = f.recvaddr;
|
context.sender->address = f.recvaddr;
|
||||||
context.sender->last_rx = now;
|
|
||||||
|
|
||||||
// if this is a dummy announcement for a node that isn't in our routing table
|
// if this is a dummy announcement for a node that isn't in our routing table
|
||||||
if (context.sender->reachable == REACHABLE_NONE &&
|
if (context.sender->reachable == REACHABLE_NONE &&
|
||||||
@ -226,6 +229,7 @@ int packetOkOverlay(struct overlay_interface *interface,unsigned char *packet, s
|
|||||||
// mark this subscriber as reachable directly via unicast.
|
// mark this subscriber as reachable directly via unicast.
|
||||||
context.sender->interface = interface;
|
context.sender->interface = interface;
|
||||||
set_reachable(context.sender, REACHABLE_UNICAST|REACHABLE_ASSUMED);
|
set_reachable(context.sender, REACHABLE_UNICAST|REACHABLE_ASSUMED);
|
||||||
|
overlay_send_probe(context.sender, f.recvaddr, interface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user