'iv_bytes' in msg is used as the packet status in the long hash service. If initial value is not 0, the long hash calculation may be abnormal. Therefore, initialize the cookie to 0.
Signed-off-by: Weili Qian qianweili@huawei.com --- v1/wd_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/v1/wd_util.c b/v1/wd_util.c index 6b8f944..a1d08b4 100644 --- a/v1/wd_util.c +++ b/v1/wd_util.c @@ -87,7 +87,7 @@ int wd_init_cookie_pool(struct wd_cookie_pool *pool, { __u64 total_size = cookies_size * cookies_num;
- pool->cookies = malloc(total_size + cookies_num); + pool->cookies = calloc(1, total_size + cookies_num); if (!pool->cookies) return -WD_ENOMEM;