aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sched/act_police.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 92649d2667ed..052855d47354 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -185,8 +185,6 @@ static int tcf_police_init(struct net *net, struct nlattr *nla,
185 new->peak_present = false; 185 new->peak_present = false;
186 } 186 }
187 187
188 if (tb[TCA_POLICE_RESULT])
189 new->tcfp_result = nla_get_u32(tb[TCA_POLICE_RESULT]);
190 new->tcfp_burst = PSCHED_TICKS2NS(parm->burst); 188 new->tcfp_burst = PSCHED_TICKS2NS(parm->burst);
191 new->tcfp_toks = new->tcfp_burst; 189 new->tcfp_toks = new->tcfp_burst;
192 if (new->peak_present) { 190 if (new->peak_present) {
@@ -198,6 +196,16 @@ static int tcf_police_init(struct net *net, struct nlattr *nla,
198 if (tb[TCA_POLICE_AVRATE]) 196 if (tb[TCA_POLICE_AVRATE])
199 new->tcfp_ewma_rate = nla_get_u32(tb[TCA_POLICE_AVRATE]); 197 new->tcfp_ewma_rate = nla_get_u32(tb[TCA_POLICE_AVRATE]);
200 198
199 if (tb[TCA_POLICE_RESULT]) {
200 new->tcfp_result = nla_get_u32(tb[TCA_POLICE_RESULT]);
201 if (TC_ACT_EXT_CMP(new->tcfp_result, TC_ACT_GOTO_CHAIN)) {
202 NL_SET_ERR_MSG(extack,
203 "goto chain not allowed on fallback");
204 err = -EINVAL;
205 goto failure;
206 }
207 }
208
201 spin_lock_bh(&police->tcf_lock); 209 spin_lock_bh(&police->tcf_lock);
202 new->tcfp_t_c = ktime_get_ns(); 210 new->tcfp_t_c = ktime_get_ns();
203 police->tcf_action = parm->action; 211 police->tcf_action = parm->action;