]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_abr.c
zebra: Convert socket interface to use `union sockunion`
[mirror_frr.git] / ospf6d / ospf6_abr.c
index 2cd3df6432b0f3a13fbd955fa28b4f9b583694e3..0ce53143b86ebb1b24dcf57bf13df06cced455d7 100644 (file)
@@ -171,8 +171,9 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route,
        /* AS External routes are never considered */
        if (route->path.type == OSPF6_PATH_TYPE_EXTERNAL1
            || route->path.type == OSPF6_PATH_TYPE_EXTERNAL2) {
-               if (is_debug)
-                       zlog_debug("Path type is external, skip");
+#if 0
+               zlog_debug("Path type is external, skip");
+#endif
                return 0;
        }
 
@@ -239,6 +240,20 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route,
                        }
                }
 
+               if (route->path.origin.type ==
+                   htons(OSPF6_LSTYPE_INTRA_PREFIX)) {
+                       if (!CHECK_FLAG(route->flag, OSPF6_ROUTE_BEST)) {
+                               if (is_debug) {
+                                       prefix2str(&route->prefix, buf,
+                                                  sizeof(buf));
+                                       zlog_debug("%s: intra-prefix route %s with cost %u is not best, ignore."
+                                          , __PRETTY_FUNCTION__, buf,
+                                          route->path.cost);
+                               }
+                               return 0;
+                       }
+               }
+
                if (is_debug) {
                        prefix2str(&route->prefix, buf, sizeof(buf));
                        zlog_debug("Originating summary in area %s for %s cost %u",
@@ -270,9 +285,10 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route,
                                ospf6_abr_delete_route(route, summary,
                                                       summary_table, old);
                        }
-               } else if (old)
+               } else if (old) {
+                       ospf6_route_remove(summary, summary_table);
                        ospf6_lsa_purge(old);
-
+               }
                return 0;
        }
 
@@ -320,7 +336,7 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route,
 
        /* if this is a route to ASBR */
        if (route->type == OSPF6_DEST_TYPE_ROUTER) {
-               /* Only the prefered best path is considered */
+               /* Only the preferred best path is considered */
                if (!CHECK_FLAG(route->flag, OSPF6_ROUTE_BEST)) {
                        if (is_debug)
                                zlog_debug(