]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/iplink_vxlan.c
utils: Introduce and use nodev() helper routine
[mirror_iproute2.git] / ip / iplink_vxlan.c
index d768c07ee23c55e1035dc52a832df5c44c2481ea..be9f35e4d9c6bc1721c5d9654a8cf56956eba175 100644 (file)
@@ -133,11 +133,8 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
                        NEXT_ARG();
                        check_duparg(&attrs, IFLA_VXLAN_LINK, "dev", *argv);
                        link = ll_name_to_index(*argv);
-                       if (link == 0) {
-                               fprintf(stderr, "Cannot find device \"%s\"\n",
-                                       *argv);
-                               exit(-1);
-                       }
+                       if (!link)
+                               exit(nodev(*argv));
                        addattr32(n, 1024, IFLA_VXLAN_LINK, link);
                } else if (!matches(*argv, "ttl") ||
                           !matches(*argv, "hoplimit")) {