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.popov...@gmail.com>
---
 ip/iplink.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ip/iplink.c b/ip/iplink.c
index 22c9a29..2db2c69 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -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) {
-- 
1.7.10.4

Reply via email to