提交 d71b029d 编写于 作者: N Neil Stainton 提交者: Tom Rini

cmd: env: Fix CRC calculation for 'env export -c -s'

Fix failure to reimport exported checksummed, size constrained data block.

'env export -c' command ignores optional -s size argument when calculating checksum causing subsequent 'env import -c' to fail.
Signed-off-by: NNeil Stainton <nstainton@asl-control.co.uk>
上级 b592936d
......@@ -987,7 +987,8 @@ NXTARG: ;
}
if (chk) {
envp->crc = crc32(0, envp->data, ENV_SIZE);
envp->crc = crc32(0, envp->data,
size ? size - offsetof(env_t, data) : ENV_SIZE);
#ifdef CONFIG_ENV_ADDR_REDUND
envp->flags = ACTIVE_FLAG;
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册