From 4d8e08dd4dcb32e1f5ba8d033f38e9bfe00b3291 Mon Sep 17 00:00:00 2001 From: Arvindsrinivasan Lakshmi narasimhan <49510474+Arvind-Brcm@users.noreply.github.com> Date: Wed, 18 Sep 2019 17:39:40 -0700 Subject: [PATCH] change in fpmsyncd to skip the lookup for the Master device name if the route object table value is zero (#1048) * change in fpmsyncd to skip the lookup for the Master device name if the route object table value is zero .i.e. the route needs to put in the global routing table --- fpmsyncd/routesync.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/fpmsyncd/routesync.cpp b/fpmsyncd/routesync.cpp index 8f05338f2d53..6f453729651e 100644 --- a/fpmsyncd/routesync.cpp +++ b/fpmsyncd/routesync.cpp @@ -45,16 +45,25 @@ void RouteSync::onMsg(int nlmsg_type, struct nl_object *obj) unsigned int master_index = rtnl_route_get_table(route_obj); char master_name[IFNAMSIZ] = {0}; - /* Get the name of the master device */ - getIfName(master_index, master_name, IFNAMSIZ); - - /* If the master device name starts with VNET_PREFIX, it is a VNET route. - The VNET name is exactly the name of the associated master device. */ - if (string(master_name).find(VNET_PREFIX) == 0) + /* if the table_id is not set in the route obj then route is for default vrf. */ + if (master_index) { - onVnetRouteMsg(nlmsg_type, obj, string(master_name)); + /* Get the name of the master device */ + getIfName(master_index, master_name, IFNAMSIZ); + + /* If the master device name starts with VNET_PREFIX, it is a VNET route. + The VNET name is exactly the name of the associated master device. */ + if (string(master_name).find(VNET_PREFIX) == 0) + { + onVnetRouteMsg(nlmsg_type, obj, string(master_name)); + } + /* Otherwise, it is a regular route (include VRF route). */ + else + { + onRouteMsg(nlmsg_type, obj); + } + } - /* Otherwise, it is a regular route (include VRF route). */ else { onRouteMsg(nlmsg_type, obj);