summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_zebra.c')
-rw-r--r--ospf6d/ospf6_zebra.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index 9b9453ce24..76e7172870 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -42,7 +42,7 @@
#include "ospf6_area.h"
#include "lib/json.h"
-DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_DISTANCE, "OSPF6 distance")
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_DISTANCE, "OSPF6 distance");
unsigned char conf_debug_ospf6_zebra = 0;
@@ -172,12 +172,23 @@ static int ospf6_zebra_if_address_update_delete(ZAPI_CALLBACK_ARGS)
return 0;
}
+static int is_prefix_default(struct prefix_ipv6 *p)
+{
+ struct prefix_ipv6 q = {};
+
+ q.family = AF_INET6;
+ q.prefixlen = 0;
+
+ return prefix_same((struct prefix *)p, (struct prefix *)&q);
+}
+
static int ospf6_zebra_read_route(ZAPI_CALLBACK_ARGS)
{
struct zapi_route api;
unsigned long ifindex;
struct in6_addr *nexthop;
struct ospf6 *ospf6;
+ struct prefix_ipv6 p;
ospf6 = ospf6_lookup_by_vrf_id(vrf_id);
@@ -205,6 +216,10 @@ static int ospf6_zebra_read_route(ZAPI_CALLBACK_ARGS)
zebra_route_string(api.type), &api.prefix, nexthop,
ifindex, api.tag);
+ memcpy(&p, &api.prefix, sizeof(p));
+ if (is_prefix_default(&p))
+ api.type = DEFAULT_ROUTE;
+
if (cmd == ZEBRA_REDISTRIBUTE_ROUTE_ADD)
ospf6_asbr_redistribute_add(api.type, ifindex, &api.prefix,
api.nexthop_num, nexthop, api.tag,