summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-09-16 15:19:15 +0400
committerDmitry Kozlov <xeb@mail.ru>2014-09-16 15:19:15 +0400
commit62dbbf500dd47c412102d9f3e9fc905bcbc3a617 (patch)
treea1271ce4f0c2536412abba62f4366baf1472a25b
parent9a7418b7cf4b46d48896c0b0be22e8f5a3893eed (diff)
downloadaccel-ppp-62dbbf500dd47c412102d9f3e9fc905bcbc3a617.tar.gz
accel-ppp-62dbbf500dd47c412102d9f3e9fc905bcbc3a617.zip
shaper: conditionally compile fq_codel support
-rw-r--r--accel-pppd/shaper/leaf_qdisc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/accel-pppd/shaper/leaf_qdisc.c b/accel-pppd/shaper/leaf_qdisc.c
index 4240a34..6c90968 100644
--- a/accel-pppd/shaper/leaf_qdisc.c
+++ b/accel-pppd/shaper/leaf_qdisc.c
@@ -153,6 +153,7 @@ out:
return 0;
}
+#ifdef TCA_FQ_CODEL_MAX
static int parse_fq_codel(char *str)
{
char *ptr1, *ptr2;
@@ -215,7 +216,7 @@ out:
return 0;
}
-
+#endif
void leaf_qdisc_parse(const char *opt)
{
@@ -232,9 +233,11 @@ void leaf_qdisc_parse(const char *opt)
if (strcmp(str, "sfq") == 0) {
if (parse_sfq(ptr1))
goto out_err;
+#ifdef TCA_FQ_CODEL_MAX
} if (strcmp(str, "fq_codel") == 0) {
if (parse_fq_codel(ptr1))
goto out_err;
+#endif
} else
log_emerg("shaper: unknown leaf-qdisc '%s'\n", str);
@@ -270,6 +273,7 @@ static int install_sfq(struct rtnl_handle *rth, int ifindex, int parent, int han
return tc_qdisc_modify(rth, ifindex, RTM_NEWQDISC, NLM_F_EXCL|NLM_F_CREATE, &opt);
}
+#ifdef TCA_FQ_CODEL_MAX
static int qdisc_fq_codel(struct qdisc_opt *qopt, struct nlmsghdr *n)
{
struct rtattr *tail = NLMSG_TAIL(n);
@@ -305,14 +309,17 @@ static int install_fq_codel(struct rtnl_handle *rth, int ifindex, int parent, in
return tc_qdisc_modify(rth, ifindex, RTM_NEWQDISC, NLM_F_EXCL|NLM_F_CREATE, &opt);
}
+#endif
int install_leaf_qdisc(struct rtnl_handle *rth, int ifindex, int parent, int handle)
{
if (conf_leaf_qdisc == LEAF_QDISC_SFQ)
return install_sfq(rth, ifindex, parent, handle);
- if (conf_leaf_qdisc == LEAF_QDISC_FQ_CODEL)
+#ifdef TCA_FQ_CODEL_MAX
+ else if (conf_leaf_qdisc == LEAF_QDISC_FQ_CODEL)
return install_fq_codel(rth, ifindex, parent, handle);
+#endif
return 0;
}