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 */