Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321477
b: refs/heads/master
c: 696ecdc
h: refs/heads/master
i:
  321475: f031265
v: v3
  • Loading branch information
Hiroaki SHIMODA authored and David S. Miller committed Aug 3, 2012
1 parent 71f4559 commit 8be7bb2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f3f9f332e231abaf28e14344733b7d000b830f7c
refs/heads/master: 696ecdc10622d86541f2e35cc16e15b6b3b1b67e
14 changes: 11 additions & 3 deletions trunk/net/sched/act_gact.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ static int tcf_gact_init(struct nlattr *nla, struct nlattr *est,
struct tcf_common *pc;
int ret = 0;
int err;
#ifdef CONFIG_GACT_PROB
struct tc_gact_p *p_parm = NULL;
#endif

if (nla == NULL)
return -EINVAL;
Expand All @@ -82,6 +85,12 @@ static int tcf_gact_init(struct nlattr *nla, struct nlattr *est,
#ifndef CONFIG_GACT_PROB
if (tb[TCA_GACT_PROB] != NULL)
return -EOPNOTSUPP;
#else
if (tb[TCA_GACT_PROB]) {
p_parm = nla_data(tb[TCA_GACT_PROB]);
if (p_parm->ptype >= MAX_RAND)
return -EINVAL;
}
#endif

pc = tcf_hash_check(parm->index, a, bind, &gact_hash_info);
Expand All @@ -103,8 +112,7 @@ static int tcf_gact_init(struct nlattr *nla, struct nlattr *est,
spin_lock_bh(&gact->tcf_lock);
gact->tcf_action = parm->action;
#ifdef CONFIG_GACT_PROB
if (tb[TCA_GACT_PROB] != NULL) {
struct tc_gact_p *p_parm = nla_data(tb[TCA_GACT_PROB]);
if (p_parm) {
gact->tcfg_paction = p_parm->paction;
gact->tcfg_pval = p_parm->pval;
gact->tcfg_ptype = p_parm->ptype;
Expand Down Expand Up @@ -133,7 +141,7 @@ static int tcf_gact(struct sk_buff *skb, const struct tc_action *a,

spin_lock(&gact->tcf_lock);
#ifdef CONFIG_GACT_PROB
if (gact->tcfg_ptype && gact_rand[gact->tcfg_ptype] != NULL)
if (gact->tcfg_ptype)
action = gact_rand[gact->tcfg_ptype](gact);
else
action = gact->tcf_action;
Expand Down

0 comments on commit 8be7bb2

Please sign in to comment.