diff options
| author | Russ White <russ@riw.us> | 2022-03-29 11:29:51 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-29 11:29:51 -0400 |
| commit | 1ab250f173335095d9c5cae2dc8f13a39a56c2cc (patch) | |
| tree | 05b0a83be94791c71ce773a31144bbd3c76426f5 /ospfd/ospf_zebra.c | |
| parent | 62336db0a38a60d490e1584e8168aad56ad04c02 (diff) | |
| parent | 5e43330e5c68e326d41f7f8e856d9a2d07892d22 (diff) | |
Merge pull request #10825 from fdumontet6WIND/ospfdefaultoriginatedissue2
ospfd: fix ospf default route wrongly sent back
Diffstat (limited to 'ospfd/ospf_zebra.c')
| -rw-r--r-- | ospfd/ospf_zebra.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index 389d3647d0..496d85fd7b 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -1280,6 +1280,7 @@ static int ospf_zebra_read_route(ZAPI_CALLBACK_ARGS) { struct zapi_route api; struct prefix_ipv4 p; + struct prefix pgen; unsigned long ifindex; struct in_addr nexthop; struct external_info *ei; @@ -1302,13 +1303,17 @@ static int ospf_zebra_read_route(ZAPI_CALLBACK_ARGS) if (IPV4_NET127(ntohl(p.prefix.s_addr))) return 0; + pgen.family = p.family; + pgen.prefixlen = p.prefixlen; + pgen.u.prefix4 = p.prefix; + /* Re-destributed route is default route. * Here, route type is used as 'ZEBRA_ROUTE_KERNEL' for * updating ex-info. But in resetting (no default-info * originate)ZEBRA_ROUTE_MAX is used to delete the ex-info. * Resolved this inconsistency by maintaining same route type. */ - if (is_default_prefix4(&p)) + if ((is_default_prefix(&pgen)) && (api.type != ZEBRA_ROUTE_OSPF)) rt_type = DEFAULT_ROUTE; if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) |
