提交 7a87827d 编写于 作者: K Keefe LIU 提交者: Xie XiuQi

ipvlan: check the value of module parameter ipvlan_default_mode

euler inclusion
category: bugfix
bugzilla: 9511
CVE: NA

-------------------------------------------------

In commit <7a0f243de9e2> "ipvlan: Introduce l2e mode", we introduced
ipvlan_default_mode as a way to enable the ipvlan's default mode.
Howerver, we didn't check the value of this module parameter.

This patch first fixed out a spelling error of "mode", and then add
the value check for ipvlan_default_mode.
Signed-off-by: NKeefe LIU <liuqifa@huawei.com>
Reviewed-by: NWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 40247945
......@@ -1074,6 +1074,10 @@ static int __init ipvlan_init_module(void)
{
int err;
if (ipvlan_default_mode >= IPVLAN_MODE_MAX ||
ipvlan_default_mode < IPVLAN_MODE_L2)
return -EINVAL;
ipvlan_init_secret();
register_netdevice_notifier(&ipvlan_notifier_block);
#if IS_ENABLED(CONFIG_IPV6)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册