]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_rnh.c
Merge pull request #5058 from mjstapp/fix_dplane_config_handler
[mirror_frr.git] / zebra / zebra_rnh.c
index da2fe4a30cd2dbfcbd7664ae39e3770a95a20aa9..5df5d94f4b805b0da740b7b82614e7a0b5bb5479 100644 (file)
@@ -62,9 +62,6 @@ static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type,
 static void print_rnh(struct route_node *rn, struct vty *vty);
 static int zebra_client_cleanup_rnh(struct zserv *client);
 
-int zebra_rnh_ip_default_route = 0;
-int zebra_rnh_ipv6_default_route = 0;
-
 void zebra_rnh_init(void)
 {
        hook_register(zserv_client_close, zebra_client_cleanup_rnh);
@@ -340,7 +337,7 @@ static void addr2hostprefix(int af, const union g_addr *addr,
                break;
        default:
                memset(prefix, 0, sizeof(*prefix));
-               zlog_debug("%s: unknown address family %d", __func__, af);
+               zlog_warn("%s: unknown address family %d", __func__, af);
                break;
        }
 }
@@ -656,7 +653,7 @@ zebra_rnh_resolve_nexthop_entry(struct zebra_vrf *zvrf, afi_t afi,
                 * match route to be exact if so specified
                 */
                if (is_default_prefix(&rn->p)
-                   && !rnh_resolve_via_default(rn->p.family)) {
+                   && !rnh_resolve_via_default(zvrf, rn->p.family)) {
                        if (IS_ZEBRA_DEBUG_NHT_DETAILED)
                                zlog_debug(
                                        "\tNot allowed to resolve through default prefix");
@@ -919,7 +916,8 @@ void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty,
 
        table = get_rnh_table(vrfid, afi, type);
        if (!table) {
-               zlog_debug("print_rnhs: rnh table not found");
+               if (IS_ZEBRA_DEBUG_NHT)
+                       zlog_debug("print_rnhs: rnh table not found");
                return;
        }
 
@@ -1201,15 +1199,17 @@ static int zebra_client_cleanup_rnh(struct zserv *client)
                                                 RNH_IMPORT_CHECK_TYPE);
                        zebra_cleanup_rnh_client(zvrf_id(zvrf), AFI_IP6, client,
                                                 RNH_IMPORT_CHECK_TYPE);
-                       if (client->proto == ZEBRA_ROUTE_LDP) {
-                               hash_iterate(zvrf->lsp_table,
-                                            mpls_ldp_lsp_uninstall_all,
-                                            zvrf->lsp_table);
-                               mpls_ldp_ftn_uninstall_all(zvrf, AFI_IP);
-                               mpls_ldp_ftn_uninstall_all(zvrf, AFI_IP6);
-                       }
                }
        }
 
        return 0;
 }
+
+int rnh_resolve_via_default(struct zebra_vrf *zvrf, int family)
+{
+       if (((family == AF_INET) && zvrf->zebra_rnh_ip_default_route)
+           || ((family == AF_INET6) && zvrf->zebra_rnh_ipv6_default_route))
+               return 1;
+       else
+               return 0;
+}