diff options
| author | Qiuwen Lu <[email protected]> | 2017-10-20 14:37:25 +0800 |
|---|---|---|
| committer | Qiuwen Lu <[email protected]> | 2017-10-20 14:37:25 +0800 |
| commit | 2a4fd4c588f66a22e3180d803d5ad61005aaa44b (patch) | |
| tree | 3a12a0e98558886383bea9876ae8376a376ed2d6 /app/include | |
| parent | 9370fdec4c2f84070d85cf6c74a1fe58eb5978d1 (diff) | |
增加静态邻居表功能,修正send_burst_options函数可能存在的double-free的问题;
- 增加静态邻居表功能,可以从文件读入邻居定义;
- 原实现在外部传入NO_FREE选项且执行报文构建失败时,仍然将缓冲区释放,造成double-free。现修正。
Diffstat (limited to 'app/include')
| -rw-r--r-- | app/include/mrapp.h | 15 |
1 files changed, 15 insertions, 0 deletions
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]; |
