netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: netdev@vger.kernel.org, patryk.sondej@gmail.com
Subject: Re: [PATCH net] inet_diag: fix inet_diag_msg_attrs_fill() for net_cls cgroup
Date: Tue, 9 May 2023 10:51:14 +0300	[thread overview]
Message-ID: <20230509075114.GD38143@unreal> (raw)
In-Reply-To: <20230509074829.GC38143@unreal>

On Tue, May 09, 2023 at 10:48:29AM +0300, Leon Romanovsky wrote:
> On Mon, May 08, 2023 at 09:21:26AM -0700, Kuniyuki Iwashima wrote:
> > From: Leon Romanovsky <leon@kernel.org>
> > Date: Mon, 8 May 2023 09:17:49 +0300
> > > On Mon, May 08, 2023 at 05:32:33AM +0200, Patryk Sondej wrote:
> > > > This commit fixes inet_diag_msg_attrs_fill() function in the ipv4/inet_diag.c file.
> > > > The problem was that the function was using CONFIG_SOCK_CGROUP_DATA to check for the net_cls cgroup.
> > > > However, the net_cls cgroup is defined by CONFIG_CGROUP_NET_CLASSID instead.
> > > > 
> > > > Therefore, this commit updates the #ifdef statement to CONFIG_CGROUP_NET_CLASSID,
> > > > and uses the sock_cgroup_classid() function to retrieve the classid from the socket cgroup.
> > > > 
> > > > This change ensures that the function correctly retrieves the classid for the net_cls cgroup
> > > > and fixes any issues related to the use of the function in this context.
> > > > 
> > > 
> > > Please add Fixes line here.
> > > 
> > > > Signed-off-by: Patryk Sondej <patryk.sondej@gmail.com>
> > > > ---
> > > >  net/ipv4/inet_diag.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
> > > > index b812eb36f0e3..7017f88911a6 100644
> > > > --- a/net/ipv4/inet_diag.c
> > > > +++ b/net/ipv4/inet_diag.c
> > > > @@ -157,7 +157,7 @@ int inet_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb,
> > > >  	    ext & (1 << (INET_DIAG_TCLASS - 1))) {
> > > >  		u32 classid = 0;
> > > >  
> > > > -#ifdef CONFIG_SOCK_CGROUP_DATA
> > > > +#ifdef CONFIG_CGROUP_NET_CLASSID
> > > 
> > > This ifdef should be deleted as sock_cgroup_classid() already has right ifdef.
> > 
> > sock_cgroup_classid() is defined under #ifdef CONFIG_SOCK_CGROUP_DATA,
> 
> Not in my kernel tree, where do you see it?

Ohh, I'm sorry, I found it.

Yes, I agree with you this patch is not needed at the end.

Thanks

      reply	other threads:[~2023-05-09  7:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-08  3:32 [PATCH net] inet_diag: fix inet_diag_msg_attrs_fill() for net_cls cgroup Patryk Sondej
2023-05-08  6:17 ` Leon Romanovsky
2023-05-08 16:21   ` Kuniyuki Iwashima
2023-05-09  7:48     ` Leon Romanovsky
2023-05-09  7:51       ` Leon Romanovsky [this message]

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=20230509075114.GD38143@unreal \
    --to=leon@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=patryk.sondej@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).