Whamcloud - gitweb
LU-6851 lnet: Ignore hops if not explicitly set
[fs/lustre-release.git] / lnet / utils / portals.c
index 8778f81..facea69 100644 (file)
@@ -1063,7 +1063,7 @@ jt_ptl_add_route (int argc, char **argv)
 {
        struct lnet_ioctl_config_data data;
        lnet_nid_t               gateway_nid;
-       unsigned int             hops = 1;
+       __u32                    hops = LNET_UNDEFINED_HOPS;
        unsigned int             priority = 0;
        char                    *end;
        int                      rc;
@@ -1084,8 +1084,9 @@ jt_ptl_add_route (int argc, char **argv)
        }
 
        if (argc > 2) {
-               hops = strtoul(argv[2], &end, 0);
-               if (hops == 0 || hops >= 256 || (end != NULL && *end != 0)) {
+               hops = strtol(argv[2], &end, 0);
+               if (hops == 0 || hops >= 256 ||
+                   (end != NULL && *end != 0)) {
                        fprintf(stderr, "Can't parse hopcount \"%s\"\n",
                                argv[2]);
                        return -1;