Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96077
b: refs/heads/master
c: 9d1045a
h: refs/heads/master
i:
  96075: b5f4f7a
v: v3
  • Loading branch information
Jamal Hadi Salim authored and David S. Miller committed May 6, 2008
1 parent 20f5e7f commit fc22716
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 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: 1da5ea1a8bf4ddb82831528223c853821cb1c9ab
refs/heads/master: 9d1045ad68fcccfaf1393cc463ab6357693e8d1d
17 changes: 9 additions & 8 deletions trunk/net/sched/act_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ static int alloc_defdata(struct tcf_defact *d, char *defdata)
return 0;
}

static int realloc_defdata(struct tcf_defact *d, char *defdata)
static void reset_policy(struct tcf_defact *d, char *defdata,
struct tc_defact *p)
{
kfree(d->tcfd_defdata);
return alloc_defdata(d, defdata);
spin_lock_bh(&d->tcf_lock);
d->tcf_action = p->action;
memset(d->tcfd_defdata, 0, SIMP_MAX_DATA);
strlcpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA);
spin_unlock_bh(&d->tcf_lock);
}

static const struct nla_policy simple_policy[TCA_DEF_MAX + 1] = {
Expand Down Expand Up @@ -129,20 +133,17 @@ static int tcf_simp_init(struct nlattr *nla, struct nlattr *est,
kfree(pc);
return ret;
}
d->tcf_action = parm->action;
ret = ACT_P_CREATED;
} else {
d = to_defact(pc);
if (!ovr) {
tcf_simp_release(d, bind);
return -EEXIST;
}
realloc_defdata(d, defdata);
reset_policy(d, defdata, parm);
}

spin_lock_bh(&d->tcf_lock);
d->tcf_action = parm->action;
spin_unlock_bh(&d->tcf_lock);

if (ret == ACT_P_CREATED)
tcf_hash_insert(pc, &simp_hash_info);
return ret;
Expand Down

0 comments on commit fc22716

Please sign in to comment.