Commit ba371d98 authored by Stephen Hemminger's avatar Stephen Hemminger

don't allow "" for device name

If a zero-length string is given, it is not rejected by
netlink in kernel so catch it at command line.
Signed-off-by: default avatarStephen Hemminger <shemminger@linux-foundation.org>
parent 550967ee
......@@ -336,6 +336,8 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
if (name) {
len = strlen(name) + 1;
if (len == 1)
invarg("null string is not valid name\n");
if (len > IFNAMSIZ)
invarg("\"name\" too long\n", *argv);
addattr_l(&req.n, sizeof(req), IFLA_IFNAME, name, len);
......
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