All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Michal Kubecek <mkubecek@suse.cz>,
	"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] genetlink: fix genlmsg_nlhdr()
Date: Wed, 15 Nov 2017 13:20:10 +0100	[thread overview]
Message-ID: <1510748410.2030.31.camel@sipsolutions.net> (raw)
In-Reply-To: <20171115120932.A6A87A0CA8@unicorn.suse.cz>

On Wed, 2017-11-15 at 13:09 +0100, Michal Kubecek wrote:
> According to the description, first argument of genlmsg_nlhdr() points to
> what genlmsg_put() returns, i.e. beginning of user header. Therefore we
> should only subtract size of genetlink header and netlink message header,
> not user header.
> 
> This also means we don't need to pass the pointer to genetlink family and
> the same is true for genl_dump_check_consistent() which is the only caller
> of genlmsg_nlhdr(). (Note that at the moment, these functions are only
> used for families which do not have user header so that they are not
> affected.)
> 
> Fixes: 670dc2833d14 ("netlink: advertise incomplete dumps")
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>

Looks sensible, though I don't think it's really needed in net since it
really has no effect - as you note, family->hdrsize is 0 for all the
families calling this right now.

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>

johannes

  reply	other threads:[~2017-11-15 12:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 12:09 [PATCH net] genetlink: fix genlmsg_nlhdr() Michal Kubecek
2017-11-15 12:20 ` Johannes Berg [this message]
2017-11-15 12:32   ` Michal Kubecek
2017-11-16  1:50 ` David Miller

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=1510748410.2030.31.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.