diff --git a/overlay_olsr.c b/overlay_olsr.c index 6afa7a79..44325ff8 100644 --- a/overlay_olsr.c +++ b/overlay_olsr.c @@ -153,7 +153,8 @@ static void parse_frame(struct overlay_buffer *buff){ context.sender->address.sin_port = htons(interface->port); 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); } } diff --git a/overlay_packetformats.c b/overlay_packetformats.c index 34d289c5..a23ccd80 100644 --- a/overlay_packetformats.c +++ b/overlay_packetformats.c @@ -214,9 +214,12 @@ int packetOkOverlay(struct overlay_interface *interface,unsigned char *packet, s 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 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 (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. context.sender->interface = interface; set_reachable(context.sender, REACHABLE_UNICAST|REACHABLE_ASSUMED); + overlay_send_probe(context.sender, f.recvaddr, interface); } }