Skip to content

Commit 4d8e08d

Browse files
Arvind-Brcmprsunny
authored andcommitted
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
1 parent da514f5 commit 4d8e08d

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

fpmsyncd/routesync.cpp

+17-8
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,25 @@ void RouteSync::onMsg(int nlmsg_type, struct nl_object *obj)
4545
unsigned int master_index = rtnl_route_get_table(route_obj);
4646
char master_name[IFNAMSIZ] = {0};
4747

48-
/* Get the name of the master device */
49-
getIfName(master_index, master_name, IFNAMSIZ);
50-
51-
/* If the master device name starts with VNET_PREFIX, it is a VNET route.
52-
The VNET name is exactly the name of the associated master device. */
53-
if (string(master_name).find(VNET_PREFIX) == 0)
48+
/* if the table_id is not set in the route obj then route is for default vrf. */
49+
if (master_index)
5450
{
55-
onVnetRouteMsg(nlmsg_type, obj, string(master_name));
51+
/* Get the name of the master device */
52+
getIfName(master_index, master_name, IFNAMSIZ);
53+
54+
/* If the master device name starts with VNET_PREFIX, it is a VNET route.
55+
The VNET name is exactly the name of the associated master device. */
56+
if (string(master_name).find(VNET_PREFIX) == 0)
57+
{
58+
onVnetRouteMsg(nlmsg_type, obj, string(master_name));
59+
}
60+
/* Otherwise, it is a regular route (include VRF route). */
61+
else
62+
{
63+
onRouteMsg(nlmsg_type, obj);
64+
}
65+
5666
}
57-
/* Otherwise, it is a regular route (include VRF route). */
5867
else
5968
{
6069
onRouteMsg(nlmsg_type, obj);

0 commit comments

Comments
 (0)