diff options
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r-- | bgpd/bgp_route.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 8ca1ac8a..bb6b1b18 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -437,8 +437,13 @@ bgp_input_modifier (struct peer *peer, struct prefix *p, struct attr *attr, info.peer = peer; info.attr = attr; + SET_FLAG (peer->rmap_type, PEER_RMAP_TYPE_IN); + /* Apply BGP route map to the attribute. */ ret = route_map_apply (ROUTE_MAP_IN (filter), p, RMAP_BGP, &info); + + peer->rmap_type = 0; + if (ret == RMAP_DENYMATCH) { /* Free newly generated AS path and community by route-map. */ @@ -702,12 +707,16 @@ bgp_announce_check (struct bgp_info *ri, struct peer *peer, struct prefix *p, dummy_attr = *attr; info.attr = &dummy_attr; } - + + SET_FLAG (peer->rmap_type, PEER_RMAP_TYPE_OUT); + if (ri->suppress) ret = route_map_apply (UNSUPPRESS_MAP (filter), p, RMAP_BGP, &info); else ret = route_map_apply (ROUTE_MAP_OUT (filter), p, RMAP_BGP, &info); + peer->rmap_type = 0; + if (ret == RMAP_DENYMATCH) { bgp_attr_flush (attr); |