From: Patrick McHardy Date: Tue, 7 Oct 2008 15:23:04 +0000 (+0200) Subject: Refuse "ip link add/replace" without device type parameter X-Git-Tag: v2.6.27~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ef0c8594283d4891e84b4b8d7d04901416aeae0;p=thirdparty%2Fiproute2.git 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: Patrick McHardy --- diff --git a/ip/iplink.c b/ip/iplink.c index 81122aec9..1c6b0d472 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -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)) {