X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Froute.c;h=3c0cf5b5b3a0d7aedc02807da006d46f26dbcc1a;hb=d6c50eb73ad49bd2eac67214995dff76b7a20661;hp=600c53dd4e1812809b8e7119d0ed77289931c7f4;hpb=07a560eab66b575f382428a956550817697e25e2;p=meshlink diff --git a/src/route.c b/src/route.c index 600c53dd..3c0cf5b5 100644 --- a/src/route.c +++ b/src/route.c @@ -141,7 +141,7 @@ static void learn_mac(mac_t *address) { splay_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 */ @@ -154,6 +154,7 @@ static void learn_mac(mac_t *address) { subnet->type = SUBNET_MAC; subnet->expires = time(NULL) + macexpire; subnet->net.mac.address = *address; + subnet->weight = 10; subnet_add(myself, subnet); /* And tell all other tinc daemons it's our MAC */ @@ -719,7 +720,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);