summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLu Qiuwen <[email protected]>2016-02-02 12:33:33 +0800
committerQiuwen Lu <[email protected]>2016-02-23 09:55:16 +0800
commite027b00871816495444bbd7dac9192ede058fe56 (patch)
tree3761bd87369ee1f2b36ab40ed1d039592620f90b
parentd188f75b9c69758ee6b3ef6355439fad7679e0d8 (diff)
修正从进程重启后初始化ARP表时段错误的Bug,原因在于从进程重启后的Hash表状态没有清空,hash函数指针指向函数地址不存在。v3.0.1-20160223
-rw-r--r--worker/udpstack.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/worker/udpstack.c b/worker/udpstack.c
index c056918..3205b56 100644
--- a/worker/udpstack.c
+++ b/worker/udpstack.c
@@ -490,11 +490,8 @@ static int arp_table_init(struct udpstack_arp_table * object, unsigned socket_id
// 检测上一次存在的HASH表,若存在,直接复位
struct rte_hash * exist_hash = rte_hash_find_existing(symbol);
- if (exist_hash != NULL)
- rte_hash_reset(exist_hash);
- else
- exist_hash = rte_hash_create(&hash_params);
-
+ if (exist_hash != NULL) rte_hash_free(exist_hash);
+ exist_hash = rte_hash_create(&hash_params);
object->hash = exist_hash;
if (unlikely(object->hash == NULL)) return -ENOSYS;
return 0;
@@ -2507,4 +2504,4 @@ int udpstack_config(const char * cfgfile)
int udpstack_destory()
{
return 0;
-} \ No newline at end of file
+}