]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Get `default-information originate` working for ospf instances
authorDonald Sharp <sharpd@nvidia.com>
Mon, 3 Jan 2022 17:15:02 +0000 (12:15 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 18 Jan 2022 13:39:40 +0000 (08:39 -0500)
The ospf instance code is not properly handling the default route
when using default-information originate.  This is because
the code is looking for the default route to be saved with an
instance of <ospf instance id> but we always save it as a instance
id of 0.  In fact OSPF asks zebra for the default route as a special
case in instance 0, always.

Here is the correct behavior:

eva# show ip ospf data

OSPF Instance: 3

       OSPF Router with ID (192.168.122.1)

                AS External Link States

Link ID         ADV Router      Age  Seq#       CkSum  Route
0.0.0.0        192.168.122.1      8 0x80000001 0xdb08 E2 0.0.0.0/0 [0x0]

eva# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:02:03

Fixes: #10251
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
ospfd/ospf_lsa.c

index 6588d702089f85b2031fd7dd4526bcb6dcb4cd45..c169996e013384eb34e05f0506871a1f2d56889d 100644 (file)
@@ -2090,8 +2090,7 @@ static struct external_info *ospf_default_external_info(struct ospf *ospf)
        p.prefix.s_addr = 0;
        p.prefixlen = 0;
 
-       default_ei = ospf_external_info_lookup(ospf, DEFAULT_ROUTE,
-                                              ospf->instance, &p);
+       default_ei = ospf_external_info_lookup(ospf, DEFAULT_ROUTE, 0, &p);
        if (!default_ei)
                return NULL;