mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-11-03 12:26:45 +00:00
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: Stephen Hemminger <shemminger@linux-foundation.org>
This commit is contained in:
parent
550967eecf
commit
ba371d9890
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user