]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
Refuse "ip link add/replace" without device type parameter
authorPatrick McHardy <kaber@trash.net>
Tue, 7 Oct 2008 15:23:04 +0000 (17:23 +0200)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Mon, 13 Oct 2008 14:03:41 +0000 (07:03 -0700)
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 <kaber@trash.net>
ip/iplink.c

index 81122aec95fecf708a9af3519540c0e35b604c3c..1c6b0d472c69a0356649148c02665e3aa2694f94 100644 (file)
@@ -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)) {