Re: sysctl net.inet.ip.arpqueued read only

2021-04-29 Thread Vitaliy Makkoveev
On Thu, Apr 29, 2021 at 09:31:57AM -0700, Greg Steuck wrote: > Alexander Bluhm writes: > >> I like this too. I somehow got the impression that macros are severely > >> frowned upon and didn't offer this kind of interface before. > >> > >> If you get this submitted, I can do a pass through the cod

Re: sysctl net.inet.ip.arpqueued read only

2021-04-29 Thread Theo de Raadt
> Q: would the introduction of SYSCTL_BOOL be considered an improvement > over "0, 1"? Absolutely gross and unneccessary. 0-1 is not neccessarily boolean. It remains entirely possible that range of values is a count.

Re: sysctl net.inet.ip.arpqueued read only

2021-04-29 Thread Greg Steuck
Alexander Bluhm writes: >> I like this too. I somehow got the impression that macros are severely >> frowned upon and didn't offer this kind of interface before. >> >> If you get this submitted, I can do a pass through the codebase to be >> sure we catch them all. Vitaliy, I volunteer to do a se

Re: sysctl net.inet.ip.arpqueued read only

2021-04-28 Thread Vitaliy Makkoveev
On Wed, Apr 28, 2021 at 12:06:26PM +0200, Alexander Bluhm wrote: > On Tue, Apr 27, 2021 at 08:22:20PM -0700, Greg Steuck wrote: > > Vitaliy Makkoveev writes: > > > > > On Tue, Apr 27, 2021 at 09:12:56PM +0200, Alexander Bluhm wrote: > > >> On Tue, Apr 27, 2021 at 12:18:02PM -0600, Theo de Raadt w

Re: sysctl net.inet.ip.arpqueued read only

2021-04-28 Thread Alexander Bluhm
On Tue, Apr 27, 2021 at 08:22:20PM -0700, Greg Steuck wrote: > Vitaliy Makkoveev writes: > > > On Tue, Apr 27, 2021 at 09:12:56PM +0200, Alexander Bluhm wrote: > >> On Tue, Apr 27, 2021 at 12:18:02PM -0600, Theo de Raadt wrote: > >> > Actually, your variation seems pretty good. Is there any reas

Re: sysctl net.inet.ip.arpqueued read only

2021-04-27 Thread Greg Steuck
Vitaliy Makkoveev writes: > On Tue, Apr 27, 2021 at 09:12:56PM +0200, Alexander Bluhm wrote: >> On Tue, Apr 27, 2021 at 12:18:02PM -0600, Theo de Raadt wrote: >> > Actually, your variation seems pretty good. Is there any reason to not >> > use this type of define? >> >> This would look like thi

Re: sysctl net.inet.ip.arpqueued read only

2021-04-27 Thread Vitaliy Makkoveev
On Tue, Apr 27, 2021 at 09:12:56PM +0200, Alexander Bluhm wrote: > On Tue, Apr 27, 2021 at 12:18:02PM -0600, Theo de Raadt wrote: > > Actually, your variation seems pretty good. Is there any reason to not > > use this type of define? > > This would look like this. > > I think sysctl_int() and sy

Re: sysctl net.inet.ip.arpqueued read only

2021-04-27 Thread Alexander Bluhm
On Tue, Apr 27, 2021 at 12:18:02PM -0600, Theo de Raadt wrote: > Actually, your variation seems pretty good. Is there any reason to not > use this type of define? This would look like this. I think sysctl_int() and sysctl_rdint() should be the primitive functions. This brings us back the 4.4BSD

Re: sysctl net.inet.ip.arpqueued read only

2021-04-27 Thread Theo de Raadt
Alexander Bluhm wrote: > On Tue, Apr 27, 2021 at 10:37:25AM -0600, Theo de Raadt wrote: > > > Would 0, 0 min, max be a simple and obvious way to say "read only" ? > > > > That is not as terrible. > > Yes. But it has another undocumented side effect. I think > sysctl_bounded_arr() inherits the

Re: sysctl net.inet.ip.arpqueued read only

2021-04-27 Thread Alexander Bluhm
On Tue, Apr 27, 2021 at 10:37:25AM -0600, Theo de Raadt wrote: > > Would 0, 0 min, max be a simple and obvious way to say "read only" ? > > That is not as terrible. Yes. But it has another undocumented side effect. I think sysctl_bounded_arr() inherits the minimum == maximum check from sysctl_i

Re: sysctl net.inet.ip.arpqueued read only

2021-04-27 Thread Theo de Raadt
Chris Cappuccio wrote: > Vitaliy Makkoveev [m...@openbsd.org] wrote: > > > > > > > On 26 Apr 2021, at 01:43, Theo de Raadt wrote: > > > > > > I am not a fan of this strange behaviour, where the min+max values > > > have additional behaviours. It is too surprising, and surprising > > > often

Re: sysctl net.inet.ip.arpqueued read only

2021-04-27 Thread Chris Cappuccio
Vitaliy Makkoveev [m...@openbsd.org] wrote: > > > > On 26 Apr 2021, at 01:43, Theo de Raadt wrote: > > > > I am not a fan of this strange behaviour, where the min+max values > > have additional behaviours. It is too surprising, and surprising > > often turns into error-prone. > > Agreed. Also

Re: sysctl net.inet.ip.arpqueued read only

2021-04-25 Thread Vitaliy Makkoveev
> On 26 Apr 2021, at 01:43, Theo de Raadt wrote: > > I am not a fan of this strange behaviour, where the min+max values > have additional behaviours. It is too surprising, and surprising > often turns into error-prone. Agreed. Also according sysctl_int_bounded() code this behaviour looks lik

Re: sysctl net.inet.ip.arpqueued read only

2021-04-25 Thread Theo de Raadt
I am not a fan of this strange behaviour, where the min+max values have additional behaviours. It is too surprising, and surprising often turns into error-prone. Alexander Bluhm wrote: > On Sun, Apr 25, 2021 at 10:08:08AM -0700, Greg Steuck wrote: > > - { IPCTL_ARPQUEUED, &la_hold_total, 0, 1

Re: sysctl net.inet.ip.arpqueued read only

2021-04-25 Thread Alexander Bluhm
On Sun, Apr 25, 2021 at 10:08:08AM -0700, Greg Steuck wrote: > - { IPCTL_ARPQUEUED, &la_hold_total, 0, 1000 }, > + { IPCTL_ARPQUEUED, &la_hold_total, 1, 0 }, > > Will make la_hold_total read-only via sysctl. This feature surprises me. When reading the caller, is is not clear what it does

Re: sysctl net.inet.ip.arpqueued read only

2021-04-25 Thread Greg Steuck
Hi Alexander, Quick bike-shed followup below. Alexander Bluhm writes: > Index: netinet/ip_input.c > === > RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_input.c,v > retrieving revision 1.356 > diff -u -p -r1.356 ip_input.c >

Re: sysctl net.inet.ip.arpqueued read only

2021-04-23 Thread Vitaliy Makkoveev
> On 23 Apr 2021, at 20:39, Alexander Bluhm wrote: > > Hi, > > The variable la_hold_total contains the number of packets currently > in the arp queue. So the sysctl net.inet.ip.arpqueued must be read > only. In if_ether.c include the header with the decalration of > la_hold_total to ensure

sysctl net.inet.ip.arpqueued read only

2021-04-23 Thread Alexander Bluhm
Hi, The variable la_hold_total contains the number of packets currently in the arp queue. So the sysctl net.inet.ip.arpqueued must be read only. In if_ether.c include the header with the decalration of la_hold_total to ensure that the definition matches. ok? bluhm Index: netinet/if_ether.c ==