From e0df4c04a0a2c78037f59e5360c3eafe1f554555 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Thu, 19 Dec 2019 10:51:13 +0200 Subject: [PATCH] bgpd: Do not apply eBGP policy for iBGP peers Treat iBGP peers as they have a policy applied. Signed-off-by: Donatas Abraitis --- bgpd/bgp_route.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 11118af400..64d7ce9e9f 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4357,6 +4357,9 @@ void bgp_clear_stale_route(struct peer *peer, afi_t afi, safi_t safi) int bgp_outbound_policy_exists(struct peer *peer, struct bgp_filter *filter) { + if (peer->sort == BGP_PEER_IBGP) + return 1; + if (peer->sort == BGP_PEER_EBGP && (ROUTE_MAP_OUT_NAME(filter) || PREFIX_LIST_OUT_NAME(filter) || FILTER_LIST_OUT_NAME(filter) @@ -4367,6 +4370,9 @@ int bgp_outbound_policy_exists(struct peer *peer, struct bgp_filter *filter) int bgp_inbound_policy_exists(struct peer *peer, struct bgp_filter *filter) { + if (peer->sort == BGP_PEER_IBGP) + return 1; + if (peer->sort == BGP_PEER_EBGP && (ROUTE_MAP_IN_NAME(filter) || PREFIX_LIST_IN_NAME(filter) || FILTER_LIST_IN_NAME(filter) -- 2.39.5