summaryrefslogtreecommitdiff
path: root/tunnat/src/runtime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tunnat/src/runtime.cc')
-rw-r--r--tunnat/src/runtime.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/tunnat/src/runtime.cc b/tunnat/src/runtime.cc
index f17689e..9143cf1 100644
--- a/tunnat/src/runtime.cc
+++ b/tunnat/src/runtime.cc
@@ -101,13 +101,18 @@ static void __phy_to_virt_link_info_check(TunnatInstance * instance, TunnatThrea
marsio_buff_t * mbuf, TunnelContainerArray &tun_array)
{
LinkInfoTable * link_info_table = th_instance->link_info_table;
- tunnat_link_id_t link_id;
+ tunnat_link_id_t link_id = (tunnat_link_id_t)(-1);
/* 未找到Link-ID */
- if(link_info_table->LookupLinkID(tun_array, link_id) < 0)
+ if(link_info_table->LookupLinkID(tun_array, link_id) == -ENOENT)
{
link_info_table->AddTunnel(tun_array, link_id);
}
+ /* 失败,直接返回 */
+ else
+ {
+ return;
+ }
auto * ctrlzone = static_cast<mr_tunnat_ctrlzone *>(marsio_buff_ctrlzone(mbuf, g_ctrlzone_id));
ctrlzone->virtual_link_id = link_id;