Re: [PATCH net] genetlink: fix genlmsg_nlhdr()

2017-11-15 Thread David Miller
From: Michal Kubecek Date: Wed, 15 Nov 2017 13:09:32 +0100 (CET) > 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

Re: [PATCH net] genetlink: fix genlmsg_nlhdr()

2017-11-15 Thread Michal Kubecek
On Wed, Nov 15, 2017 at 01:20:10PM +0100, Johannes Berg wrote: > 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 subtrac

Re: [PATCH net] genetlink: fix genlmsg_nlhdr()

2017-11-15 Thread Johannes Berg
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 heade

[PATCH net] genetlink: fix genlmsg_nlhdr()

2017-11-15 Thread Michal Kubecek
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 genetlin