]> granicus.if.org Git - libnl/commitdiff
lib/route: add /usr/lib64/tc/ search path for netem dist file
authorThomas Haller <thaller@redhat.com>
Mon, 14 Aug 2017 08:10:18 +0000 (10:10 +0200)
committerThomas Haller <thaller@redhat.com>
Mon, 14 Aug 2017 08:10:18 +0000 (10:10 +0200)
https://github.com/thom311/libnl/issues/148

lib/route/qdisc/netem.c

index 1d7b868fa92f98b1ded6793d098fcbce4b1b276b..c4ba2a1fe80fdf570524e5ed948ee7203c4771d2 100644 (file)
@@ -886,14 +886,20 @@ int rtnl_netem_set_delay_distribution(struct rtnl_qdisc *qdisc, const char *dist
        char name[NAME_MAX];
        char dist_suffix[] = ".dist";
 
+       /* Check several locations for the dist file */
+       char *test_path[] = {
+               "",
+               "./",
+               "/usr/lib/tc/",
+               "/usr/lib64/tc/",
+               "/usr/local/lib/tc/",
+       };
+
        /* If the given filename already ends in .dist, don't append it later */
        char *test_suffix = strstr(dist_type, dist_suffix);
        if (test_suffix != NULL && strlen(test_suffix) == 5)
                strcpy(dist_suffix, "");
 
-       /* Check several locations for the dist file */
-       char *test_path[] = { "", "./", "/usr/lib/tc/", "/usr/local/lib/tc/" };
-
        for (i = 0; i < ARRAY_SIZE(test_path); i++) {
                snprintf(name, NAME_MAX, "%s%s%s", test_path[i], dist_type, dist_suffix);
                if ((f = fopen(name, "re")))