network: fix lxc_netdev_rename_by_index()

Return an error code when the name is invalid instead of pretending that things are fine. Closes #3044. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent f00010ff
......@@ -1160,8 +1160,10 @@ int lxc_netdev_rename_by_index(int ifindex, const char *newname)
return err;
len = strlen(newname);
if (len == 1 || len >= IFNAMSIZ)
if (len == 1 || len >= IFNAMSIZ) {
err = -EINVAL;
goto out;
}
err = -ENOMEM;
nlmsg = nlmsg_alloc(NLMSG_GOOD_SIZE);
......
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