summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-01-03 12:15:02 -0500
committerDonald Sharp <sharpd@nvidia.com>2022-01-18 08:39:40 -0500
commitffa484b4bd922c91a4acc734de3186a444482cb6 (patch)
treea6fc8d99a0be28b608bd726482f72116662b09b5
parent0fa6d92b90afd29d1ef867d3d2666dd9c7e4fd4a (diff)
ospfd: Get `default-information originate` working for ospf instances
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>
-rw-r--r--ospfd/ospf_lsa.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 6588d70208..c169996e01 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -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;