@@ -21,7 +21,8 @@ RouteSync::RouteSync(RedisPipeline *pipeline) :
21
21
m_routeTable(pipeline, APP_ROUTE_TABLE_NAME, true ),
22
22
m_vnet_routeTable(pipeline, APP_VNET_RT_TABLE_NAME, true ),
23
23
m_vnet_tunnelTable(pipeline, APP_VNET_RT_TUNNEL_TABLE_NAME, true ),
24
- m_warmStartHelper(pipeline, &m_routeTable, APP_ROUTE_TABLE_NAME, " bgp" , " bgp" )
24
+ m_warmStartHelper(pipeline, &m_routeTable, APP_ROUTE_TABLE_NAME, " bgp" , " bgp" ),
25
+ m_nl_sock(NULL ), m_link_cache(NULL )
25
26
{
26
27
m_nl_sock = nl_socket_alloc ();
27
28
nl_connect (m_nl_sock, NETLINK_ROUTE);
@@ -291,7 +292,8 @@ bool RouteSync::getIfName(int if_index, char *if_name, size_t name_len)
291
292
/* Cannot get interface name. Possibly the interface gets re-created. */
292
293
if (!rtnl_link_i2name (m_link_cache, if_index, if_name, name_len))
293
294
{
294
- rtnl_link_alloc_cache (m_nl_sock, AF_UNSPEC, &m_link_cache);
295
+ /* Trying to refill cache */
296
+ nl_cache_refill (m_nl_sock, m_link_cache);
295
297
if (!rtnl_link_i2name (m_link_cache, if_index, if_name, name_len))
296
298
{
297
299
return false ;
0 commit comments