]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Store original route-map type for the peer
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 25 Oct 2017 00:41:59 +0000 (20:41 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 27 Nov 2017 13:21:56 +0000 (08:21 -0500)
When we are applying an experimental route-map type
to a peer( as part of a show command ) save and
restore the peer's ->rmap_type.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_route.c

index 3a7cfc4f2cfabe87c9e1829d8f6abeab48f11b05..1d267f259f5d9934661f4c1bf64ec471358bd73b 100644 (file)
@@ -1160,6 +1160,7 @@ static int bgp_output_modifier(struct peer *peer, struct prefix *p,
        struct bgp_info info;
        route_map_result_t ret;
        struct route_map *rmap = NULL;
+       u_char rmap_type;
 
        /*
         * So if we get to this point and have no rmap_name
@@ -1188,12 +1189,13 @@ static int bgp_output_modifier(struct peer *peer, struct prefix *p,
        info.peer = peer;
        info.attr = attr;
 
+       rmap_type = peer->rmap_type;
        SET_FLAG(peer->rmap_type, PEER_RMAP_TYPE_OUT);
 
        /* Apply BGP route map to the attribute. */
        ret = route_map_apply(rmap, p, RMAP_BGP, &info);
 
-       peer->rmap_type = 0;
+       peer->rmap_type = rmap_type;
 
        if (ret == RMAP_DENYMATCH)
                /*