]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #4179 from donaldsharp/mroute_show
authorJafar Al-Gharaibeh <Jafaral@users.noreply.github.com>
Tue, 23 Apr 2019 16:18:22 +0000 (11:18 -0500)
committerGitHub <noreply@github.com>
Tue, 23 Apr 2019 16:18:22 +0000 (11:18 -0500)
Mroute show

bgpd/bgp_filter.c
bgpd/bgp_filter.h
bgpd/bgp_route.c
lib/if_rmap.c
pimd/pim_upstream.c
ripd/rip_offset.c
ripd/ripd.c
ripd/ripd.h
ripngd/ripng_offset.c
ripngd/ripngd.c
ripngd/ripngd.h

index a788ea68f3fb1db630b310b5713f281eacd21a21..b262f6b56d707aab304f1f7e52464befba4e4748 100644 (file)
@@ -389,7 +389,7 @@ static int as_list_dup_check(struct as_list *aslist, struct as_filter *new)
        return 0;
 }
 
-static int config_bgp_aspath_validate(const char *regstr)
+int config_bgp_aspath_validate(const char *regstr)
 {
        char valid_chars[] = "1234567890_^|[,{}() ]$*+.?-\\";
 
index e54372f8e064e90d38129c723fe397a7f9481106..3c49e357ffddf297479d47e009fb69dec162a15b 100644 (file)
@@ -31,5 +31,6 @@ extern enum as_filter_type as_list_apply(struct as_list *, void *);
 extern struct as_list *as_list_lookup(const char *);
 extern void as_list_add_hook(void (*func)(char *));
 extern void as_list_delete_hook(void (*func)(const char *));
+extern int config_bgp_aspath_validate(const char *regstr);
 
 #endif /* _QUAGGA_BGP_FILTER_H */
index 7036ededac405dae3f24c2e38920bb6dd76e2edb..7850666085cc74e5d1cb651efc4867d4680ef473 100644 (file)
@@ -4218,6 +4218,13 @@ static void bgp_cleanup_table(struct bgp *bgp, struct bgp_table *table,
        for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn))
                for (pi = bgp_node_get_bgp_path_info(rn); pi; pi = next) {
                        next = pi->next;
+
+                       /* Unimport EVPN routes from VRFs */
+                       if (safi == SAFI_EVPN)
+                               bgp_evpn_unimport_route(bgp, AFI_L2VPN,
+                                                       SAFI_EVPN,
+                                                       &rn->p, pi);
+
                        if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)
                            && pi->type == ZEBRA_ROUTE_BGP
                            && (pi->sub_type == BGP_ROUTE_NORMAL
@@ -9985,6 +9992,12 @@ static int bgp_show_regexp(struct vty *vty, struct bgp *bgp, const char *regstr,
        regex_t *regex;
        int rc;
 
+       if (!config_bgp_aspath_validate(regstr)) {
+               vty_out(vty, "Invalid character in as-path access-list %s\n",
+                       regstr);
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+
        regex = bgp_regcomp(regstr);
        if (!regex) {
                vty_out(vty, "Can't compile regexp %s\n", regstr);
index d8236b6b255e3829c446dea3ad6d27b9da18111d..b0802da96147950c5848ed87d552b1d0e6d4e719 100644 (file)
@@ -291,6 +291,7 @@ int config_write_if_rmap(struct vty *vty,
 
 void if_rmap_ctx_delete(struct if_rmap_ctx *ctx)
 {
+       listnode_delete(if_rmap_ctx_list, ctx);
        hash_clean(ctx->ifrmaphash, (void (*)(void *))if_rmap_free);
        if (ctx->name)
                XFREE(MTYPE_IF_RMAP_CTX_NAME, ctx);
index 7de2092a53cca3616c465f0bd0156067f34d6f05..b708e86a2050891625ab06f6a1c44e4beed6d5a7 100644 (file)
@@ -584,9 +584,10 @@ void pim_upstream_switch(struct pim_instance *pim, struct pim_upstream *up,
        pim_upstream_update_assert_tracking_desired(up);
 
        if (new_state == PIM_UPSTREAM_JOINED) {
+               pim_upstream_inherited_olist_decide(pim, up);
                if (old_state != PIM_UPSTREAM_JOINED) {
                        int old_fhr = PIM_UPSTREAM_FLAG_TEST_FHR(up->flags);
-                       forward_on(up);
+
                        pim_msdp_up_join_state_changed(pim, up);
                        if (pim_upstream_could_register(up)) {
                                PIM_UPSTREAM_FLAG_SET_FHR(up->flags);
@@ -601,8 +602,6 @@ void pim_upstream_switch(struct pim_instance *pim, struct pim_upstream *up,
                                pim_upstream_send_join(up);
                                join_timer_start(up);
                        }
-               } else {
-                       forward_on(up);
                }
        } else {
 
index b3f84fe50f6a702b1ae8b54415e795c5ff9d0f16..8307a95d27b3b11a792297d8b82105b3e8247bf6 100644 (file)
@@ -50,6 +50,11 @@ struct rip_offset_list *rip_offset_list_new(struct rip *rip, const char *ifname)
 void offset_list_del(struct rip_offset_list *offset)
 {
        listnode_delete(offset->rip->offset_list_master, offset);
+       offset_list_free(offset);
+}
+
+void offset_list_free(struct rip_offset_list *offset)
+{
        if (OFFSET_LIST_IN_NAME(offset))
                free(OFFSET_LIST_IN_NAME(offset));
        if (OFFSET_LIST_OUT_NAME(offset))
index 201de9a46e0b3f46942e999f230f6ff06442c63a..3a1ffd17a6f47561d7b54a1e40f4c71e77509602 100644 (file)
@@ -2712,7 +2712,7 @@ struct rip *rip_create(const char *vrf_name, struct vrf *vrf, int socket)
        rip->passive_nondefault = vector_init(1);
        rip->offset_list_master = list_new();
        rip->offset_list_master->cmp = (int (*)(void *, void *))offset_list_cmp;
-       rip->offset_list_master->del = (void (*)(void *))offset_list_del;
+       rip->offset_list_master->del = (void (*)(void *))offset_list_free;
 
        /* Distribute list install. */
        rip->distribute_ctx = distribute_list_ctx_create(vrf);
index 7b196a16be40e13a489b05918965b6e6efd35634..44f5932fb69a2c99e0bfa27a506cac86b9ce978c 100644 (file)
@@ -507,6 +507,7 @@ extern struct rip_info *rip_ecmp_delete(struct rip *rip,
 extern struct rip_offset_list *rip_offset_list_new(struct rip *rip,
                                                   const char *ifname);
 extern void offset_list_del(struct rip_offset_list *offset);
+extern void offset_list_free(struct rip_offset_list *offset);
 extern struct rip_offset_list *rip_offset_list_lookup(struct rip *rip,
                                                      const char *ifname);
 extern int rip_offset_list_apply_in(struct prefix_ipv4 *, struct interface *,
index 41ba2360ba07d5b4510328dc23fc33efacc661d5..fe95ccfc2bdf18907fbf91fd6d2c10a58dbf20cc 100644 (file)
@@ -56,6 +56,11 @@ struct ripng_offset_list *ripng_offset_list_new(struct ripng *ripng,
 void ripng_offset_list_del(struct ripng_offset_list *offset)
 {
        listnode_delete(offset->ripng->offset_list_master, offset);
+       ripng_offset_list_free(offset);
+}
+
+void ripng_offset_list_free(struct ripng_offset_list *offset)
+{
        if (OFFSET_LIST_IN_NAME(offset))
                free(OFFSET_LIST_IN_NAME(offset));
        if (OFFSET_LIST_OUT_NAME(offset))
index b36cee2c5d5a1f156b3c0654e72d577362e0d48f..411689a7a720eeb761419d2483b55a6011d03ed7 100644 (file)
@@ -1889,7 +1889,7 @@ struct ripng *ripng_create(const char *vrf_name, struct vrf *vrf, int socket)
        ripng->offset_list_master->cmp =
                (int (*)(void *, void *))offset_list_cmp;
        ripng->offset_list_master->del =
-               (void (*)(void *))ripng_offset_list_del;
+               (void (*)(void *))ripng_offset_list_free;
        ripng->distribute_ctx = distribute_list_ctx_create(vrf);
        distribute_list_add_hook(ripng->distribute_ctx,
                                 ripng_distribute_update);
index dcc61ae58a0e6249b2d98011179a962d6961c262..dc425b6958c60228c6c0bdc331a1bdc7380300cc 100644 (file)
@@ -421,6 +421,7 @@ extern void ripng_peer_list_del(void *arg);
 extern struct ripng_offset_list *ripng_offset_list_new(struct ripng *ripng,
                                                       const char *ifname);
 extern void ripng_offset_list_del(struct ripng_offset_list *offset);
+extern void ripng_offset_list_free(struct ripng_offset_list *offset);
 extern struct ripng_offset_list *ripng_offset_list_lookup(struct ripng *ripng,
                                                          const char *ifname);
 extern int ripng_offset_list_apply_in(struct ripng *ripng,