From: Patrick McHardy <kaber@trash.net>
To: Linux Netdev List <netdev@vger.kernel.org>,
Stephen Hemminger <shemminger@vyatta.com>
Subject: [IPROUTE]: Refuse "ip link add/replace" without device type parameter
Date: Tue, 07 Oct 2008 17:16:27 +0200 [thread overview]
Message-ID: <48EB7D4B.4030501@trash.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: 02.diff --]
[-- Type: text/x-patch, Size: 956 bytes --]
commit c3ae059edf3316cff1075c2401bdeefa5e262251
Author: Patrick McHardy <kaber@trash.net>
Date: Tue Oct 7 16:55:21 2008 +0200
[IPROUTE]: Refuse "ip link add/replace" without device type parameter
Fix confusing error message noticed by Martin Josefsson:
# 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 <kaber@trash.net>
diff --git a/ip/iplink.c b/ip/iplink.c
index 81122ae..6e9ac71 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 informatin: \"type\" argument "
+ "is required\n");
+ return -1;
}
if (!(flags & NLM_F_CREATE)) {
next reply other threads:[~2008-10-07 15:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-07 15:16 Patrick McHardy [this message]
2008-10-07 15:23 ` [IPROUTE]: Refuse "ip link add/replace" without device type parameter Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48EB7D4B.4030501@trash.net \
--to=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).