Forget addresses of unreachable nodes.
[tinc] / src / route.c
index 2da781e..1642389 100644 (file)
@@ -104,7 +104,7 @@ static void learn_mac(mac_t *address) {
        avl_node_t *node;
        connection_t *c;
 
-       subnet = lookup_subnet_mac(address);
+       subnet = lookup_subnet_mac(myself, address);
 
        /* If we don't know this MAC address yet, store it */
 
@@ -117,6 +117,7 @@ static void learn_mac(mac_t *address) {
                subnet->type = SUBNET_MAC;
                subnet->expires = now + macexpire;
                subnet->net.mac.address = *address;
+               subnet->weight = 10;
                subnet_add(myself, subnet);
 
                /* And tell all other tinc daemons it's our MAC */
@@ -704,7 +705,7 @@ static void route_mac(node_t *source, vpn_packet_t *packet) {
        /* Lookup destination address */
 
        memcpy(&dest, &packet->data[0], sizeof dest);
-       subnet = lookup_subnet_mac(&dest);
+       subnet = lookup_subnet_mac(NULL, &dest);
 
        if(!subnet) {
                broadcast_packet(source, packet);