]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
iplink: Fix "alias" parameter length calculations
authorSerhey Popovych <serhe.popovych@gmail.com>
Thu, 18 Jan 2018 14:24:40 +0000 (16:24 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 19 Jan 2018 00:24:43 +0000 (16:24 -0800)
We need NEXT_ARG() to get *argv pointing to "alias"
parameter value. Overwise we get and check "alias"
string length.

Fixes: f88becf35e08 ("iplink: Process "alias" parameter correctly")
Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iplink.c

index 22c9a29ceea249dd001742bfd5df871b1cdaa781..2db2c691c1f918322f760f74362be6774a3e801e 100644 (file)
@@ -778,10 +778,10 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
                        argc--; argv++;
                        break;
                } else if (matches(*argv, "alias") == 0) {
+                       NEXT_ARG();
                        len = strlen(*argv);
                        if (len >= IFALIASZ)
                                invarg("alias too long\n", *argv);
-                       NEXT_ARG();
                        addattr_l(&req->n, sizeof(*req), IFLA_IFALIAS,
                                  *argv, len);
                } else if (strcmp(*argv, "group") == 0) {