diff options
author | Kozlov Dmitry <dima@server> | 2011-02-07 15:07:24 +0300 |
---|---|---|
committer | Kozlov Dmitry <dima@server> | 2011-02-07 15:07:24 +0300 |
commit | a2fe6bb78b048a0214a2c3e02e26105179ec4c3a (patch) | |
tree | c59182f7b28edd9416d64f15cd0352345f876a71 /accel-pppd/extra | |
parent | 38077f9b9d9e86f4a7d2317b3697ea4370889999 (diff) | |
download | accel-ppp-a2fe6bb78b048a0214a2c3e02e26105179ec4c3a.tar.gz accel-ppp-a2fe6bb78b048a0214a2c3e02e26105179ec4c3a.zip |
shaper: fixed rate change from cli
Diffstat (limited to 'accel-pppd/extra')
-rw-r--r-- | accel-pppd/extra/shaper_tbf.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/accel-pppd/extra/shaper_tbf.c b/accel-pppd/extra/shaper_tbf.c index cc0ff22..7ea48d0 100644 --- a/accel-pppd/extra/shaper_tbf.c +++ b/accel-pppd/extra/shaper_tbf.c @@ -818,13 +818,18 @@ static void shaper_change_help(char * const *f, int f_cnt, void *cli) static void shaper_change(struct shaper_pd_t *pd) { - if ((pd->temp_down_speed && pd->temp_up_speed) || (pd->down_speed && pd->up_speed)) + if (pd->down_speed && pd->up_speed) remove_shaper(pd->ppp->ifname); - if (pd->temp_down_speed && pd->temp_up_speed) + if (pd->temp_down_speed && pd->temp_up_speed) { + pd->down_speed = pd->temp_down_speed; + pd->up_speed = pd->temp_up_speed; install_shaper(pd->ppp->ifname, pd->temp_down_speed, 0, pd->temp_up_speed, 0); - else if (pd->down_speed && pd->up_speed) + } else if (pd->cur_tr->down_speed && pd->cur_tr->up_speed) { + pd->down_speed = pd->cur_tr->down_speed; + pd->up_speed = pd->cur_tr->up_speed; install_shaper(pd->ppp->ifname, pd->cur_tr->down_speed, pd->cur_tr->down_burst, pd->cur_tr->up_speed, pd->cur_tr->up_burst); + } } static int shaper_change_exec(const char *cmd, char * const *f, int f_cnt, void *cli) |