Commit 49428bf3 by Dongsheng Yang Committed by Serge Hallyn

network: check result of if_nametoindex().

When we want to get index of a ifname which does not exist, we should return a -EINVAL in this case. Signed-off-by: 's avatarDongsheng Yang <yangds.fnst@cn.fujitsu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent 59978166
......@@ -144,6 +144,8 @@ int lxc_netdev_move_by_name(const char *ifname, pid_t pid)
return -EINVAL;
index = if_nametoindex(ifname);
if (!index)
return -EINVAL;
return lxc_netdev_move_by_index(index, pid);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment