@@ -128,12 +128,12 @@ void RouteSync::onRouteMsg(int nlmsg_type, struct nl_object *obj)
128128 }
129129
130130 /* Get nexthop lists */
131- string gw_ips = getNextHopGw (route_obj);
132- string if_names = getNextHopIf (route_obj);
131+ string nexthops = getNextHopGw (route_obj);
132+ string ifnames = getNextHopIf (route_obj);
133133
134134 vector<FieldValueTuple> fvVector;
135- FieldValueTuple nh (" nexthop" , gw_ips );
136- FieldValueTuple idx (" ifname" , if_names );
135+ FieldValueTuple nh (" nexthop" , nexthops );
136+ FieldValueTuple idx (" ifname" , ifnames );
137137
138138 fvVector.push_back (nh);
139139 fvVector.push_back (idx);
@@ -142,7 +142,7 @@ void RouteSync::onRouteMsg(int nlmsg_type, struct nl_object *obj)
142142 {
143143 m_routeTable.set (destipprefix, fvVector);
144144 SWSS_LOG_DEBUG (" RouteTable set msg: %s %s %s\n " ,
145- destipprefix, gw_ips .c_str (), if_names .c_str ());
145+ destipprefix, nexthops .c_str (), ifnames .c_str ());
146146 }
147147
148148 /*
@@ -152,7 +152,7 @@ void RouteSync::onRouteMsg(int nlmsg_type, struct nl_object *obj)
152152 else
153153 {
154154 SWSS_LOG_INFO (" Warm-Restart mode: RouteTable set msg: %s %s %s\n " ,
155- destipprefix, gw_ips .c_str (), if_names .c_str ());
155+ destipprefix, nexthops .c_str (), ifnames .c_str ());
156156
157157 const KeyOpFieldsValuesTuple kfv = std::make_tuple (destipprefix,
158158 SET_COMMAND,
@@ -212,41 +212,41 @@ void RouteSync::onVnetRouteMsg(int nlmsg_type, struct nl_object *obj)
212212 }
213213
214214 /* Get nexthop lists */
215- string gw_ips = getNextHopGw (route_obj);
216- string if_names = getNextHopIf (route_obj);
215+ string nexthops = getNextHopGw (route_obj);
216+ string ifnames = getNextHopIf (route_obj);
217217
218218 /* If the the first interface name starts with VXLAN_IF_NAME_PREFIX,
219219 the route is a VXLAN tunnel route. */
220- if (if_names .find (VXLAN_IF_NAME_PREFIX) == 0 )
220+ if (ifnames .find (VXLAN_IF_NAME_PREFIX) == 0 )
221221 {
222222 vector<FieldValueTuple> fvVector;
223- FieldValueTuple ep (" endpoint" , gw_ips );
223+ FieldValueTuple ep (" endpoint" , nexthops );
224224 fvVector.push_back (ep);
225225
226226 m_vnet_tunnelTable.set (vnet_dip, fvVector);
227227 SWSS_LOG_DEBUG (" %s set msg: %s %s\n " ,
228- APP_VNET_RT_TUNNEL_TABLE_NAME, vnet_dip.c_str (), gw_ips .c_str ());
228+ APP_VNET_RT_TUNNEL_TABLE_NAME, vnet_dip.c_str (), nexthops .c_str ());
229229 return ;
230230 }
231231 /* Regular VNET route */
232232 else
233233 {
234234 vector<FieldValueTuple> fvVector;
235- FieldValueTuple idx (" ifname" , if_names );
235+ FieldValueTuple idx (" ifname" , ifnames );
236236 fvVector.push_back (idx);
237237
238- /* If the route has at least one next hop gateway */
239- if (gw_ips .length () + 1 > (unsigned int )rtnl_route_get_nnexthops (route_obj))
238+ /* If the route has at least one next hop gateway, e.g., nexthops does not only have ',' */
239+ if (nexthops .length () + 1 > (unsigned int )rtnl_route_get_nnexthops (route_obj))
240240 {
241- FieldValueTuple nh (" nexthop" , gw_ips );
241+ FieldValueTuple nh (" nexthop" , nexthops );
242242 fvVector.push_back (nh);
243243 SWSS_LOG_DEBUG (" %s set msg: %s %s %s\n " ,
244- APP_VNET_RT_TABLE_NAME, vnet_dip.c_str (), if_names .c_str (), gw_ips .c_str ());
244+ APP_VNET_RT_TABLE_NAME, vnet_dip.c_str (), ifnames .c_str (), nexthops .c_str ());
245245 }
246246 else
247247 {
248248 SWSS_LOG_DEBUG (" %s set msg: %s %s\n " ,
249- APP_VNET_RT_TABLE_NAME, vnet_dip.c_str (), if_names .c_str ());
249+ APP_VNET_RT_TABLE_NAME, vnet_dip.c_str (), ifnames .c_str ());
250250 }
251251
252252 m_vnet_routeTable.set (vnet_dip, fvVector);
0 commit comments