From: Jakub Kicinski <kuba@kernel.org>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: netdev@vger.kernel.org, jiri@resnulli.us,
xiyou.wangcong@gmail.com, davem@davemloft.net,
edumazet@google.com, security@kernel.org, nnamrec@gmail.com
Subject: Re: [PATCH net 1/1 v3] net: sched: Disallow replacing of child qdisc from one parent to another
Date: Wed, 15 Jan 2025 17:33:35 -0800 [thread overview]
Message-ID: <20250115173335.0f142a28@kernel.org> (raw)
In-Reply-To: <CAM0EoM=zzidXbUNYUfnV-P5vVU7KOYZJPw7bdfKt4+nSdyWCvw@mail.gmail.com>
On Wed, 15 Jan 2025 15:39:43 -0500 Jamal Hadi Salim wrote:
> > diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> > index 300430b8c4d2..fac9c946a4c7 100644
> > --- a/net/sched/sch_api.c
> > +++ b/net/sched/sch_api.c
> > @@ -1664,6 +1664,10 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
> > q = qdisc_lookup(dev, tcm->tcm_handle);
> > if (!q)
> > goto create_n_graft;
> > + if (q->parent != tcm->tcm_parent) {
> > + NL_SET_ERR_MSG(extack, "Cannot move an existing qdisc to a different parent");
> > + return -EINVAL;
> > + }
>
> Yes, this should work as well - doesnt have to save the leaf_q, so more optimal.
> Please send the patch.
I'm gonna keep your commit and just post a v4, hope that's okay.
next prev parent reply other threads:[~2025-01-16 1:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-11 15:14 [PATCH net 1/1 v3] net: sched: Disallow replacing of child qdisc from one parent to another Jamal Hadi Salim
2025-01-15 1:26 ` Jakub Kicinski
2025-01-15 14:15 ` Jamal Hadi Salim
2025-01-15 14:36 ` Jakub Kicinski
2025-01-15 14:53 ` Jamal Hadi Salim
2025-01-15 15:51 ` Jakub Kicinski
2025-01-15 20:39 ` Jamal Hadi Salim
2025-01-16 1:33 ` Jakub Kicinski [this message]
2025-01-16 13:34 ` Jamal Hadi Salim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250115173335.0f142a28@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=nnamrec@gmail.com \
--cc=security@kernel.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).