]> git.puffer.fish Git - mirror/frr.git/commitdiff
fabricd: add support for completely unnumbered operation
authorChristian Franke <chris@opensourcerouting.org>
Thu, 7 Jun 2018 10:58:42 +0000 (12:58 +0200)
committerChristian Franke <chris@opensourcerouting.org>
Wed, 5 Sep 2018 09:38:13 +0000 (11:38 +0200)
With this commit, fabricd can run without any IPv4 addresses configured
except on loopback. There are two changes to achieve this:

a) If a circuit has no IPv4 address configured, fabricd will resort to
advertise the routers loopback IP in the OpenFabric hellos.

b) All the routes from OpenFabric are sent with ZEBRA_FLAG_ONLINK set,
so that zebra will install them into the fib without checking whether
the nexthop is reachable

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
isisd/fabricd.c
isisd/fabricd.h
isisd/isis_pdu.c
isisd/isis_zebra.c

index b52f2b554ea23e491a5738843315733cfc39f53b..7951efe5a114016c4d6353fea176fd01d600a277 100644 (file)
@@ -691,3 +691,27 @@ void fabricd_trigger_csnp(struct isis_area *area)
                                      &circuit->t_send_csnp[ISIS_LEVEL2 - 1]);
        }
 }
+
+struct list *fabricd_ip_addrs(struct isis_circuit *circuit)
+{
+       if (circuit->ip_addrs && listcount(circuit->ip_addrs))
+               return circuit->ip_addrs;
+
+       if (!fabricd || !circuit->area || !circuit->area->circuit_list)
+               return NULL;
+
+       struct listnode *node;
+       struct isis_circuit *c;
+
+       for (ALL_LIST_ELEMENTS_RO(circuit->area->circuit_list, node, c)) {
+               if (c->circ_type != CIRCUIT_T_LOOPBACK)
+                       continue;
+
+               if (!c->ip_addrs || !listcount(c->ip_addrs))
+                       return NULL;
+
+               return c->ip_addrs;
+       }
+
+       return NULL;
+}
index f54c7bf89e460e603ff83404e93a4719d23c7d8e..76c182f2d27816e1b1fc5cb71ccc8584fbb80ba6 100644 (file)
@@ -44,5 +44,6 @@ uint8_t fabricd_tier(struct isis_area *area);
 int fabricd_write_settings(struct isis_area *area, struct vty *vty);
 void fabricd_lsp_flood(struct isis_lsp *lsp);
 void fabricd_trigger_csnp(struct isis_area *area);
+struct list *fabricd_ip_addrs(struct isis_circuit *circuit);
 
 #endif
index fc9ff5143f305f2fc5f8bb3c92ce9fe3da166779..88575f531943770c7155aba12fa36757fd96a075 100644 (file)
@@ -679,7 +679,7 @@ static int process_hello(uint8_t pdu_type, struct isis_circuit *circuit,
                goto out;
        }
 
-       iih.v4_usable = (circuit->ip_addrs && listcount(circuit->ip_addrs)
+       iih.v4_usable = (fabricd_ip_addrs(circuit)
                         && iih.tlvs->ipv4_address.count);
 
        iih.v6_usable = (circuit->ipv6_link && listcount(circuit->ipv6_link)
@@ -1689,8 +1689,12 @@ int send_hello(struct isis_circuit *circuit, int level)
                                                     false, false);
        }
 
-       if (circuit->ip_router && circuit->ip_addrs)
-               isis_tlvs_add_ipv4_addresses(tlvs, circuit->ip_addrs);
+       if (circuit->ip_router) {
+               struct list *circuit_ip_addrs = fabricd_ip_addrs(circuit);
+
+               if (circuit_ip_addrs)
+                       isis_tlvs_add_ipv4_addresses(tlvs, circuit_ip_addrs);
+       }
 
        if (circuit->ipv6_router && circuit->ipv6_link)
                isis_tlvs_add_ipv6_addresses(tlvs, circuit->ipv6_link);
index 220f131b63d1b93a0fe2f19774abed143fd62833..33d8a0f77172036155ea8a5cb845195137fd9821 100644 (file)
@@ -261,6 +261,8 @@ static void isis_zebra_route_add_route(struct prefix *prefix,
                return;
 
        memset(&api, 0, sizeof(api));
+       if (fabricd)
+               api.flags |= ZEBRA_FLAG_ONLINK;
        api.vrf_id = VRF_DEFAULT;
        api.type = PROTO_TYPE;
        api.safi = SAFI_UNICAST;