Re: ieee80211_stats userland vs. kernel

2022-03-09 Thread Stefan Sperling
On Tue, Mar 08, 2022 at 02:38:39PM -0700, Theo de Raadt wrote: > Stefan Sperling wrote: > > In this case it is not ifconfig, but netstat -W iwm0. > > Which is a debugging tool, like netstat -s. > > We don't care when netstat breaks Alright, then this diff is indeed not necessary.

Re: ieee80211_stats userland vs. kernel

2022-03-08 Thread Theo de Raadt
Stefan Sperling wrote: > On Tue, Mar 08, 2022 at 12:58:27PM -0700, Theo de Raadt wrote: > > Claudio Jeker wrote: > > > > > Honestly I think this is overkill. There is no stat struct where we do > > > this dance. It is accepted that netstat needs to keep in sync for these > > > structs to work.

Re: ieee80211_stats userland vs. kernel

2022-03-08 Thread Stefan Sperling
On Tue, Mar 08, 2022 at 12:58:27PM -0700, Theo de Raadt wrote: > Claudio Jeker wrote: > > > Honestly I think this is overkill. There is no stat struct where we do > > this dance. It is accepted that netstat needs to keep in sync for these > > structs to work. Why is it necessary to disconnect

Re: ieee80211_stats userland vs. kernel

2022-03-08 Thread Theo de Raadt
Claudio Jeker wrote: > Honestly I think this is overkill. There is no stat struct where we do > this dance. It is accepted that netstat needs to keep in sync for these > structs to work. Why is it necessary to disconnect the kernel and userland > for this? Actually there is a major one: it is

Re: ieee80211_stats userland vs. kernel

2022-03-08 Thread Claudio Jeker
On Tue, Mar 08, 2022 at 07:17:33PM +0100, Stefan Sperling wrote: > On Tue, Mar 08, 2022 at 03:55:48PM +0100, Stefan Sperling wrote: > > On Mon, Mar 07, 2022 at 03:04:06PM -0700, Theo de Raadt wrote: > > > > For now, the structs are identical so the code copying data out is > > > > kept simple. > >

Re: ieee80211_stats userland vs. kernel

2022-03-08 Thread Stefan Sperling
On Tue, Mar 08, 2022 at 03:55:48PM +0100, Stefan Sperling wrote: > On Mon, Mar 07, 2022 at 03:04:06PM -0700, Theo de Raadt wrote: > > > For now, the structs are identical so the code copying data out is > > > kept simple. > > > > I think this is unwise, and you should write the field-by-field

Re: ieee80211_stats userland vs. kernel

2022-03-08 Thread Stefan Sperling
On Mon, Mar 07, 2022 at 03:04:06PM -0700, Theo de Raadt wrote: > > For now, the structs are identical so the code copying data out is > > kept simple. > > I think this is unwise, and you should write the field-by-field copying > function at the same time, otherwise this is just asking for

Re: ieee80211_stats userland vs. kernel

2022-03-07 Thread Theo de Raadt
> For now, the structs are identical so the code copying data out is > kept simple. I think this is unwise, and you should write the field-by-field copying function at the same time, otherwise this is just asking for trouble. You really cannot wait until an intentional change.

ieee80211_stats userland vs. kernel

2022-03-07 Thread Stefan Sperling
There is another net80211 ioctl which shares a struct between kernel and userland: struct ieee80211_stats shown by the netstat -W command. While it is trivial to recompile netstat when this struct is changed, giving the kernel a separate struct type would allow us to add, change, or remove