summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-08-14 08:10:18 (GMT)
committerThomas Haller <thaller@redhat.com>2017-08-14 08:10:18 (GMT)
commit69b730e23e79adb8f38fff018c2b108b9ca9cfb7 (patch)
tree5aa693d31bc6c81bf6e343a509a8dada01a98c71 /lib
parentcda0d805aa62eed5264099d42455114277fd12cf (diff)
downloadlibnl-69b730e23e79adb8f38fff018c2b108b9ca9cfb7.zip
libnl-69b730e23e79adb8f38fff018c2b108b9ca9cfb7.tar.gz
libnl-69b730e23e79adb8f38fff018c2b108b9ca9cfb7.tar.bz2
lib/route: add /usr/lib64/tc/ search path for netem dist file
https://github.com/thom311/libnl/issues/148
Diffstat (limited to 'lib')
-rw-r--r--lib/route/qdisc/netem.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/route/qdisc/netem.c b/lib/route/qdisc/netem.c
index 1d7b868..c4ba2a1 100644
--- a/lib/route/qdisc/netem.c
+++ b/lib/route/qdisc/netem.c
@@ -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")))