Merge tag 'configfs-5.15' of git://git.infradead.org/users/hch/configfs
[linux-2.6-microblaze.git] / net / sched / act_simple.c
index a4f3d0f..cbbe186 100644 (file)
@@ -52,7 +52,7 @@ static int alloc_defdata(struct tcf_defact *d, const struct nlattr *defdata)
        d->tcfd_defdata = kzalloc(SIMP_MAX_DATA, GFP_KERNEL);
        if (unlikely(!d->tcfd_defdata))
                return -ENOMEM;
-       nla_strlcpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA);
+       nla_strscpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA);
        return 0;
 }
 
@@ -71,7 +71,7 @@ static int reset_policy(struct tc_action *a, const struct nlattr *defdata,
        spin_lock_bh(&d->tcf_lock);
        goto_ch = tcf_action_set_ctrlact(a, p->action, goto_ch);
        memset(d->tcfd_defdata, 0, SIMP_MAX_DATA);
-       nla_strlcpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA);
+       nla_strscpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA);
        spin_unlock_bh(&d->tcf_lock);
        if (goto_ch)
                tcf_chain_put_by_act(goto_ch);
@@ -85,11 +85,11 @@ static const struct nla_policy simple_policy[TCA_DEF_MAX + 1] = {
 
 static int tcf_simp_init(struct net *net, struct nlattr *nla,
                         struct nlattr *est, struct tc_action **a,
-                        int ovr, int bind, bool rtnl_held,
                         struct tcf_proto *tp, u32 flags,
                         struct netlink_ext_ack *extack)
 {
        struct tc_action_net *tn = net_generic(net, simp_net_id);
+       bool bind = flags & TCA_ACT_FLAGS_BIND;
        struct nlattr *tb[TCA_DEF_MAX + 1];
        struct tcf_chain *goto_ch = NULL;
        struct tc_defact *parm;
@@ -147,7 +147,7 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,
                tcf_action_set_ctrlact(*a, parm->action, goto_ch);
                ret = ACT_P_CREATED;
        } else {
-               if (!ovr) {
+               if (!(flags & TCA_ACT_FLAGS_REPLACE)) {
                        err = -EEXIST;
                        goto release_idr;
                }