From 2a4fd4c588f66a22e3180d803d5ad61005aaa44b Mon Sep 17 00:00:00 2001 From: Qiuwen Lu Date: Fri, 20 Oct 2017 14:37:25 +0800 Subject: 增加静态邻居表功能,修正send_burst_options函数可能存在的double-free的问题; - 增加静态邻居表功能,可以从文件读入邻居定义; - 原实现在外部传入NO_FREE选项且执行报文构建失败时,仍然将缓冲区释放,造成double-free。现修正。 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/include/mrapp.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'app/include') diff --git a/app/include/mrapp.h b/app/include/mrapp.h index f070761..c95e3cb 100644 --- a/app/include/mrapp.h +++ b/app/include/mrapp.h @@ -55,6 +55,19 @@ struct mr_thread_info cpu_id_t cpu_id; }; +/* 静态邻居表项 */ +struct mr_static_neigh_entry +{ + TAILQ_ENTRY(mr_static_entry) next; + struct in_addr in_addr; + struct ether_addr ether_addr; + char devsym[MR_SYMBOL_MAX]; + char str_in_addr[MR_SYMBOL_MAX]; + char str_ether_addr[MR_SYMBOL_MAX]; +}; + +TAILQ_HEAD(mr_static_neigh_list, mr_static_neigh_entry); + struct mr_instance { /* ==== 运行句柄 ==== */ @@ -83,6 +96,8 @@ struct mr_instance struct neighbour_manager * neigh; /* 负载均衡器 */ struct distributer * dist_object; + /* 静态邻居表 */ + struct mr_static_neigh_list static_neigh_list; /* 统计 */ struct mrapp_stat stat[MR_SID_MAX]; -- cgit v1.2.3