aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sched/act_gact.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
index 6cff56696a81..85de7efd5fea 100644
--- a/net/sched/act_gact.c
+++ b/net/sched/act_gact.c
@@ -48,14 +48,14 @@ static struct tcf_hashinfo gact_hash_info = {
48#ifdef CONFIG_GACT_PROB 48#ifdef CONFIG_GACT_PROB
49static int gact_net_rand(struct tcf_gact *gact) 49static int gact_net_rand(struct tcf_gact *gact)
50{ 50{
51 if (net_random() % gact->tcfg_pval) 51 if (!gact->tcfg_pval || net_random() % gact->tcfg_pval)
52 return gact->tcf_action; 52 return gact->tcf_action;
53 return gact->tcfg_paction; 53 return gact->tcfg_paction;
54} 54}
55 55
56static int gact_determ(struct tcf_gact *gact) 56static int gact_determ(struct tcf_gact *gact)
57{ 57{
58 if (gact->tcf_bstats.packets % gact->tcfg_pval) 58 if (!gact->tcfg_pval || gact->tcf_bstats.packets % gact->tcfg_pval)
59 return gact->tcf_action; 59 return gact->tcf_action;
60 return gact->tcfg_paction; 60 return gact->tcfg_paction;
61} 61}