Skip to content

Commit

Permalink
change in fpmsyncd to skip the lookup for the Master device name if t…
Browse files Browse the repository at this point in the history
…he 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
  • Loading branch information
Arvind-Brcm authored and prsunny committed Sep 19, 2019
1 parent da514f5 commit 4d8e08d
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions fpmsyncd/routesync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4d8e08d

Please sign in to comment.