* [IPROUTE]: Refuse "ip link add/replace" without device type parameter
@ 2008-10-07 15:16 Patrick McHardy
2008-10-07 15:23 ` Patrick McHardy
0 siblings, 1 reply; 2+ messages in thread
From: Patrick McHardy @ 2008-10-07 15:16 UTC (permalink / raw)
To: Linux Netdev List, Stephen Hemminger
[-- 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)) {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [IPROUTE]: Refuse "ip link add/replace" without device type parameter
2008-10-07 15:16 [IPROUTE]: Refuse "ip link add/replace" without device type parameter Patrick McHardy
@ 2008-10-07 15:23 ` Patrick McHardy
0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2008-10-07 15:23 UTC (permalink / raw)
To: Linux Netdev List, Stephen Hemminger
[-- Attachment #1: Type: text/plain, Size: 61 bytes --]
Fix typo noticed by Phil Oester: information vs. informatin
[-- Attachment #2: 02.diff --]
[-- Type: text/x-patch, Size: 957 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 information: \"type\" argument "
+ "is required\n");
+ return -1;
}
if (!(flags & NLM_F_CREATE)) {
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-07 15:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-07 15:16 [IPROUTE]: Refuse "ip link add/replace" without device type parameter Patrick McHardy
2008-10-07 15:23 ` Patrick McHardy
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).