From f1a9bd2d2db3634e31690a5eca23f24af8bbc031 Mon Sep 17 00:00:00 2001 From: Jarek Poplawski Date: Wed, 4 Mar 2009 17:38:10 -0800 Subject: [PATCH] --- yaml --- r: 132145 b: refs/heads/master c: a883bf564ea555447a76682bb2d8d4bc92e23e0e h: refs/heads/master i: 132143: 79a238547552b91ceb5a25062d14c24f73e2f4b0 v: v3 --- [refs] | 2 +- trunk/net/sched/act_police.c | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 820461743ac2..c6c81daddb2c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9f8ac0b7b063be77f0de7a27fe5e6a0aa2cce58d +refs/heads/master: a883bf564ea555447a76682bb2d8d4bc92e23e0e diff --git a/trunk/net/sched/act_police.c b/trunk/net/sched/act_police.c index 5c72a116b1a4..f8f047b61245 100644 --- a/trunk/net/sched/act_police.c +++ b/trunk/net/sched/act_police.c @@ -183,13 +183,6 @@ static int tcf_act_police_locate(struct nlattr *nla, struct nlattr *est, if (R_tab == NULL) goto failure; - if (!est && (ret == ACT_P_CREATED || - !gen_estimator_active(&police->tcf_bstats, - &police->tcf_rate_est))) { - err = -EINVAL; - goto failure; - } - if (parm->peakrate.rate) { P_tab = qdisc_get_rtab(&parm->peakrate, tb[TCA_POLICE_PEAKRATE]); @@ -205,6 +198,12 @@ static int tcf_act_police_locate(struct nlattr *nla, struct nlattr *est, &police->tcf_lock, est); if (err) goto failure_unlock; + } else if (tb[TCA_POLICE_AVRATE] && + (ret == ACT_P_CREATED || + !gen_estimator_active(&police->tcf_bstats, + &police->tcf_rate_est))) { + err = -EINVAL; + goto failure_unlock; } /* No failure allowed after this point */