summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/accel-ppp.conf1
-rw-r--r--accel-pppd/shaper/limiter.c7
-rw-r--r--accel-pppd/shaper/shaper.c7
-rw-r--r--accel-pppd/shaper/shaper.h1
4 files changed, 12 insertions, 4 deletions
diff --git a/accel-pppd/accel-ppp.conf b/accel-pppd/accel-ppp.conf
index 00e08c5..644ebea 100644
--- a/accel-pppd/accel-ppp.conf
+++ b/accel-pppd/accel-ppp.conf
@@ -200,6 +200,7 @@ gw-ip-address=192.168.100.1
#up-burst-factor=1.0
#latency=50
#mpu=0
+#mtu=0
#r2q=10
#quantum=1500
#cburst=1534
diff --git a/accel-pppd/shaper/limiter.c b/accel-pppd/shaper/limiter.c
index 9f89ba7..af1e3ba 100644
--- a/accel-pppd/shaper/limiter.c
+++ b/accel-pppd/shaper/limiter.c
@@ -25,7 +25,6 @@ static int qdisc_tbf(struct qdisc_opt *qopt, struct nlmsghdr *n)
{
struct tc_tbf_qopt opt;
__u32 rtab[256];
- int mtu = 0;
int Rcell_log = -1;
unsigned int linklayer = LINKLAYER_ETHERNET; /* Assume ethernet */
struct rtattr *tail;
@@ -35,7 +34,7 @@ static int qdisc_tbf(struct qdisc_opt *qopt, struct nlmsghdr *n)
opt.rate.rate = qopt->rate;
opt.limit = (double)qopt->rate * qopt->latency + qopt->buffer;
opt.rate.mpu = conf_mpu;
- if (tc_calc_rtable(&opt.rate, rtab, Rcell_log, mtu, linklayer) < 0) {
+ if (tc_calc_rtable(&opt.rate, rtab, Rcell_log, conf_mtu, linklayer) < 0) {
log_ppp_error("shaper: failed to calculate rate table.\n");
return -1;
}
@@ -73,7 +72,7 @@ static int qdisc_htb_class(struct qdisc_opt *qopt, struct nlmsghdr *n)
struct tc_htb_opt opt;
__u32 rtab[256],ctab[256];
int cell_log=-1,ccell_log = -1;
- unsigned mtu = 1600;
+ unsigned mtu = conf_mtu ? conf_mtu : 1600;
unsigned int linklayer = LINKLAYER_ETHERNET; /* Assume ethernet */
struct rtattr *tail;
@@ -190,7 +189,7 @@ static int install_police(struct rtnl_handle *rth, int ifindex, int rate, int bu
__u32 rtab[256];
struct rtattr *tail, *tail1, *tail2, *tail3;
int Rcell_log = -1;
- int mtu = 0, flowid = 1;
+ int mtu = conf_mtu, flowid = 1;
unsigned int linklayer = LINKLAYER_ETHERNET; /* Assume ethernet */
struct {
diff --git a/accel-pppd/shaper/shaper.c b/accel-pppd/shaper/shaper.c
index 7219d72..9594caf 100644
--- a/accel-pppd/shaper/shaper.c
+++ b/accel-pppd/shaper/shaper.c
@@ -36,6 +36,7 @@ double conf_down_burst_factor = 0.1;
double conf_up_burst_factor = 1;
double conf_latency = 0.05;
int conf_mpu = 0;
+int conf_mtu = 0;
int conf_quantum = 1500;
int conf_r2q = 10;
int conf_cburst = 1534;
@@ -898,6 +899,12 @@ static void load_config(void)
if (opt && atoi(opt) >= 0)
conf_mpu = atoi(opt);
+ opt = conf_get_opt("shaper", "mtu");
+ if (opt)
+ conf_mtu = atoi(opt);
+ else
+ conf_mtu = 0;
+
opt = conf_get_opt("shaper", "r2q");
if (opt && atoi(opt) >= 0)
conf_r2q = atoi(opt);
diff --git a/accel-pppd/shaper/shaper.h b/accel-pppd/shaper/shaper.h
index 6322a6b..4e6b9ff 100644
--- a/accel-pppd/shaper/shaper.h
+++ b/accel-pppd/shaper/shaper.h
@@ -30,6 +30,7 @@ extern double conf_down_burst_factor;
extern double conf_up_burst_factor;
extern double conf_latency;
extern int conf_mpu;
+extern int conf_mtu;
extern int conf_quantum;
extern int conf_r2q;
extern int conf_cburst;