]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #9088 from donaldsharp/zebra_redistribute_wrong_tables
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 27 Jul 2021 12:14:23 +0000 (14:14 +0200)
committerGitHub <noreply@github.com>
Tue, 27 Jul 2021 12:14:23 +0000 (14:14 +0200)
zebra: Do not allow redistribution for non-vrf tables

zebra/redistribute.c

index 89f46f9c97a030d61ea0bd43c8b253cc19775594..26f6d404e95f4a2bd6de375ab5e3ab334709aa97 100644 (file)
@@ -153,10 +153,16 @@ static bool zebra_redistribute_check(const struct route_entry *re,
                                     struct zserv *client,
                                     const struct prefix *p, int afi)
 {
+       struct zebra_vrf *zvrf;
+
        /* Process only if there is valid re */
        if (!re)
                return false;
 
+       zvrf = vrf_info_lookup(re->vrf_id);
+       if (re->vrf_id == VRF_DEFAULT && zvrf->table_id != re->table)
+               return false;
+
        /* If default route and redistributed */
        if (is_default_prefix(p)
            && vrf_bitmap_check(client->redist_default[afi], re->vrf_id))