2003-08-11 kunihiro <kunihiro@zebra.org
* bgp_route{,map}.c: Extend 'set ip next-hop' in route-maps with
ability to specify 'peer-address' rather than IP.
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 8ca1ac8..bb6b1b1 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -437,8 +437,13 @@
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 @@
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);