Commit 3ef0c859 authored by Patrick McHardy's avatar Patrick McHardy Committed by Stephen Hemminger

Refuse "ip link add/replace" without device type parameter

Fix confusing error message noticed by Martin Josefsson:
Fix typo noticed by Phil Oester: information vs. informatin

# ip link add
RTNETLINK answers: Operation not supported

The reason is missing device type information, refuse this and print a message.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 05325552
......@@ -336,6 +336,10 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
return -1;
}
linkinfo->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)linkinfo;
} else if (flags & NLM_F_CREATE) {
fprintf(stderr, "Not enough information: \"type\" argument "
"is required\n");
return -1;
}
if (!(flags & NLM_F_CREATE)) {
......
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