All of lore.kernel.org
 help / color / mirror / Atom feed
* iw: some stats are missing from nla_policy
@ 2021-06-25 10:10 Sergey Naumov
  2021-06-25 17:38 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Naumov @ 2021-06-25 10:10 UTC (permalink / raw)
  To: linux-wireless

Hello.

I'm developing an application that uses libnl to get some wireless
stats and I use iw code as an example.

I noticed that not all parameters are added to nla_policy. For
example, NL80211_STA_INFO_CONNECTED_TIME
(https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/commit/?id=087d778f6f82346debfd275ddbb8f646f9a1a167)
is parsed, but absent from stats_policy.

The question is whether it is done accidentally or deliberately? Is
there some hidden logic not to add attributes to policy? And then why
to use policy at all if some attributes are not checked anyway?

Thanks in advance,
Sergey.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: iw: some stats are missing from nla_policy
  2021-06-25 10:10 iw: some stats are missing from nla_policy Sergey Naumov
@ 2021-06-25 17:38 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2021-06-25 17:38 UTC (permalink / raw)
  To: Sergey Naumov, linux-wireless

Hi Sergey,
> 
> I noticed that not all parameters are added to nla_policy. For
> example, NL80211_STA_INFO_CONNECTED_TIME
> (https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/commit/?id=087d778f6f82346debfd275ddbb8f646f9a1a167)
> is parsed, but absent from stats_policy.
> 
> The question is whether it is done accidentally or deliberately? Is
> there some hidden logic not to add attributes to policy? And then why
> to use policy at all if some attributes are not checked anyway?

No, there's no particular reason or policy (pun intended) to this ...

It's kind of just being a bit lazy, and we have to trust the kernel to
not kill the process anyway, in a sense. But I think the right way still
would be to have a policy so we can detect errors.

johannes


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-25 17:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 10:10 iw: some stats are missing from nla_policy Sergey Naumov
2021-06-25 17:38 ` Johannes Berg

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.