X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fsched%2Fact_gact.c;h=85de7efd5fea7b29ca7a208633c5740f1a1762e5;hb=a163148c1bec895c1332ea5be497bcda8ce110df;hp=6cff56696a81dca4187cf649eb922bd2e906e637;hpb=12e36b2f41b6cbc67386fcb9c59c32a3e2033905;p=linux-2.6 diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c index 6cff56696a..85de7efd5f 100644 --- a/net/sched/act_gact.c +++ b/net/sched/act_gact.c @@ -48,14 +48,14 @@ static struct tcf_hashinfo gact_hash_info = { #ifdef CONFIG_GACT_PROB static int gact_net_rand(struct tcf_gact *gact) { - if (net_random() % gact->tcfg_pval) + if (!gact->tcfg_pval || net_random() % gact->tcfg_pval) return gact->tcf_action; return gact->tcfg_paction; } static int gact_determ(struct tcf_gact *gact) { - if (gact->tcf_bstats.packets % gact->tcfg_pval) + if (!gact->tcfg_pval || gact->tcf_bstats.packets % gact->tcfg_pval) return gact->tcf_action; return gact->tcfg_paction; }