提交 2306f656 编写于 作者: A Alexander Aring 提交者: Marcel Holtmann

6lowpan: iphc: fix invalid case handling

This patch fixes the return value in a case which should never occur.
Instead returning "-EINVAL" we return LOWPAN_IPHC_DAM_00 which is
invalid on context based addresses. Also change the WARN_ON_ONCE to
WARN_ONCE which was suggested by Dan Carpenter.
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NAlexander Aring <aar@pengutronix.de>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 395174bb
......@@ -811,8 +811,8 @@ static u8 lowpan_compress_ctx_addr(u8 **hc_ptr, const struct in6_addr *ipaddr,
goto out;
}
WARN_ON_ONCE("context found but no address mode matched\n");
return -EINVAL;
WARN_ONCE(1, "context found but no address mode matched\n");
return LOWPAN_IPHC_DAM_00;
out:
if (sam)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册