From 7b102a5cf7bd0f943f71d2e03f1adfaf2828c9cc Mon Sep 17 00:00:00 2001 From: Nischal Sheth Date: Thu, 16 Oct 2014 11:44:26 -0700 Subject: [PATCH] Fix circular route re-origination bug with transit VN Problem: When a service is applied between a VN and a transit VN, routes from the VN that are re-originated into the transit VN as ServiceChain routes get re-originated again as ServiceChain routes into the regular VN. Cause: Implementation prior to transit VN used to ignore routes that did belong to the destination VN of the service chain. Code changes for transit VN functionality relaxed this check, but did not cover the case where route belongs to the source VN. Fix: Add check to ignore routes from source VN. Change-Id: Ic6f5520217eca64b79f5144d71f80aa6d661e48a Partial-Bug: 1365277 --- src/bgp/routing-instance/service_chaining.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bgp/routing-instance/service_chaining.cc b/src/bgp/routing-instance/service_chaining.cc index fd6fbcf2fd6..303bdfdcd71 100644 --- a/src/bgp/routing-instance/service_chaining.cc +++ b/src/bgp/routing-instance/service_chaining.cc @@ -131,8 +131,11 @@ bool ServiceChain::Match(BgpServer *server, BgpTable *table, deleted = true; int vn_index = GetOriginVnIndex(route); + int src_vn_index = src_->virtual_network_index(); int dest_vn_index = dest_->virtual_network_index(); if (!vn_index || dest_vn_index != vn_index) { + if (src_vn_index == vn_index) + deleted = true; if (!dest_->virtual_network_allow_transit()) deleted = true; if (!dest_vn_index)