summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_abr.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2021-03-30 16:34:05 +0200
committerGitHub <noreply@github.com>2021-03-30 16:34:05 +0200
commit1bed7a6fef0bb50c9f7e5b42ae59578336620102 (patch)
tree3fcd1123b88400c7e6bd08a4a86f240dfc4fc2cb /ospf6d/ospf6_abr.c
parentMerge pull request #8137 from Orange-OpenSource/ospf_ls (diff)
parenttopotests: add tests for OSPFv3 default route (diff)
downloadfrr-1bed7a6fef0bb50c9f7e5b42ae59578336620102.tar.xz
frr-1bed7a6fef0bb50c9f7e5b42ae59578336620102.zip
Merge pull request #8057 from ranjanyash54/default-route
ospf6d: Default Route functionality
Diffstat (limited to 'ospf6d/ospf6_abr.c')
-rw-r--r--ospf6d/ospf6_abr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c
index 2393cd671..27d4f0755 100644
--- a/ospf6d/ospf6_abr.c
+++ b/ospf6d/ospf6_abr.c
@@ -46,6 +46,7 @@
#include "ospf6_flood.h"
#include "ospf6_intra.h"
+#include "ospf6_asbr.h"
#include "ospf6_abr.h"
#include "ospf6d.h"
@@ -646,10 +647,24 @@ void ospf6_abr_defaults_to_stub(struct ospf6 *o)
struct listnode *node, *nnode;
struct ospf6_area *oa;
struct ospf6_route *def, *route;
+ struct ospf6_redist *red;
+ int type = DEFAULT_ROUTE;
+ struct prefix_ipv6 p = {};
if (!o->backbone)
return;
+ red = ospf6_redist_lookup(o, type, 0);
+ if (!red)
+ return;
+
+ p.family = AF_INET6;
+ p.prefixlen = 0;
+
+ route = ospf6_route_lookup((struct prefix *)&p, o->external_table);
+ if (!route)
+ return;
+
def = ospf6_route_create();
def->type = OSPF6_DEST_TYPE_NETWORK;
def->prefix.family = AF_INET6;
@@ -659,6 +674,8 @@ void ospf6_abr_defaults_to_stub(struct ospf6 *o)
def->path.type = OSPF6_PATH_TYPE_INTER;
def->path.subtype = OSPF6_PATH_SUBTYPE_DEFAULT_RT;
def->path.area_id = o->backbone->area_id;
+ def->path.metric_type = metric_type(o, type, 0);
+ def->path.cost = metric_value(o, type, 0);
for (ALL_LIST_ELEMENTS(o->area_list, node, nnode, oa)) {
if (!IS_AREA_STUB(oa)) {