Re: snmpd_metrics: differentiate between hrSWRunName and hrSWRunPath

2023-10-24 Thread Theo Buehler
On Wed, Oct 18, 2023 at 01:49:00PM +0200, Martijn van Duren wrote: > Right now we return the same value for both hrSWRunName and hrSWRunPath. > hrSWRunPath should return the full path of the binary, and hrSWRunName > a description of the running software. > > Afaik there's no proper way to retriev

Re: snmpd_metrics: add HOST-RESOURCES-MIB:hrSWRunPerfTable

2023-10-24 Thread Theo Buehler
On Wed, Oct 18, 2023 at 11:54:06AM +0200, Martijn van Duren wrote: > This diff adds the two entries from the hrSWRunPerfTable: > hrSWRunPerfCPU, and hrSWRunPerfMem. This allows snmptop from the > net-snmp package to work. Math stolen^Wcopied from top/machine.c. > > OK? ok > > martijn@ > > Inde

Cruft: stop creating /usr/local/share/nls directories

2023-10-24 Thread Christian Weisgerber
The /usr/local/share/nls tree for localized message catalogs has barely ever been used throughout the whole history of the ports tree. The main user was shells/tcsh and that stopped four years ago. Now, a single port is left that installs a single file there. I would like to stop creating those

Re: ibuf free fd on close

2023-10-24 Thread Theo Buehler
> Thanks. Do we have a list of ports that use ibuf / imsg? Here's a list obtained from the nm output of all ports by grepping for '^ibuf_.* U' and '^imsg_.* U', respectively, then weeding out the obvious false positives:: ibuf: mail/opensmtpd-extras,-main net/ladvd imsg: audio/amused devel/go

Re: ibuf free fd on close

2023-10-24 Thread Theo Buehler
On Tue, Oct 24, 2023 at 04:00:42PM +0200, Claudio Jeker wrote: > On Tue, Oct 24, 2023 at 03:50:47PM +0200, Theo Buehler wrote: > > On Tue, Oct 24, 2023 at 03:01:26PM +0200, Claudio Jeker wrote: > > > When I added ibuf_get_fd() the idea was to make sure that ibuf_free() will > > > close any fd still

Re: ibuf free fd on close

2023-10-24 Thread Claudio Jeker
On Tue, Oct 24, 2023 at 03:50:47PM +0200, Theo Buehler wrote: > On Tue, Oct 24, 2023 at 03:01:26PM +0200, Claudio Jeker wrote: > > When I added ibuf_get_fd() the idea was to make sure that ibuf_free() will > > close any fd still on the buffer. This way even if a fd is unexpectedly > > passed nothin

Re: ibuf free fd on close

2023-10-24 Thread Theo Buehler
On Tue, Oct 24, 2023 at 03:01:26PM +0200, Claudio Jeker wrote: > When I added ibuf_get_fd() the idea was to make sure that ibuf_free() will > close any fd still on the buffer. This way even if a fd is unexpectedly > passed nothing will happen. > > That code was disabled at start because userland w

ibuf free fd on close

2023-10-24 Thread Claudio Jeker
When I added ibuf_get_fd() the idea was to make sure that ibuf_free() will close any fd still on the buffer. This way even if a fd is unexpectedly passed nothing will happen. That code was disabled at start because userland was not fully ready. In particular rpki-client did not handle that well. A

Re: boot loaders: softraid volumes must be on RAID partitions

2023-10-24 Thread Crystal Kolipe
On Tue, Oct 24, 2023 at 01:44:08AM +, Klemens Nanni wrote: > Rereading the code, I now question why it checks the 'a' label type at all. > > Taking your sd0d example through devboot(): > > |#ifdef SOFTRAID > | /* > | * Determine the partition type for the 'a' partition of the > |

Re: snmpd [15/16]: When we have an error, all oids must be identical to the request

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 03:31:20PM +0200, Martijn van Duren wrote: > RFC3416 section 4.2.1 (and others) tells us that if an error occurs the > varbindlist in the response must be identical to the original request. > > There might be other edge-cases here, but let's at least make sure that > the OI

Re: snmpd [14/16]: Validate the returned error code

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 03:28:12PM +0200, Martijn van Duren wrote: > > Certain error codes are only intended for certain request-types. Add an > appl_error_valid() function to test for this. ok tb

Re: snmpd [13/16]: registered instances must not return below OID

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 03:25:29PM +0200, Martijn van Duren wrote: > If a backend registers as an instance it must never return OIDs below > their registration. Add a test for this in appl_varbind_valid(). > > OK? ok with a tiny nit inline > > martijn@ > > diff --git a/application.c b/applicat

Re: snmpd [12/16]: Make ab_range in application_agentx explicit 1

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 03:21:45PM +0200, Martijn van Duren wrote: > appl_agentx_session doesn't set ab_range explicitly to 1, and thus > relies on malloc randomness to set it. Sit it explicitly. ok, but I haven't verified that all the session's members are now initialized. > > OK? > > martijn@

Re: snmpd [11/16]: When a request results in EOMV we must return the requesting OID

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 03:17:19PM +0200, Martijn van Duren wrote: > According to RFC3416 section 4.2.2 and 4.2.3 case "(2)" when an > endOfMibView is returned the OID must be identical to originally > requested OID. Currently this can fail when the original request > is in a !last registered regio

Re: snmpd [10/16]: Make retries on open session where connection is closed return early

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 03:13:57PM +0200, Martijn van Duren wrote: > Here's a special case unlikely to be found in the wild: > When opening 2 sessions on an agentx connection (already unusual) and > registering 2 overlapping regions on the different sessions, e.g. by > differing in priority (even m

Re: snmpd [9/16]: Fix range handling with appl_unregister

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 03:11:18PM +0200, Martijn van Duren wrote: > Right now (un)registering a region with range_subid set to !0 will > fail. Apparently nothing in the wild uses this, but let's fix it. > > This is the unregister part. ok tb

Re: snmpd [8/16]: Fix range handling with appl_register

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 03:08:00PM +0200, Martijn van Duren wrote: > Right now (un)registering a region with range_subid set to !0 will > fail. Apparently nothing in the wild uses this, but let's fix it. > > This is the register part. ok tb

Re: snmpd [7/16]: Treat agentx-close-pdu with reasonByManager as a parseerror

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 03:03:16PM +0200, Martijn van Duren wrote: > > RFC2741 section 6.2.2 says that reasonByManager can only be used by the > agentx master. Treat this reason as a parseerror. ok tb

Re: snmpd [6/16]: support close reason for appl_agentx_free

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 02:59:52PM +0200, Martijn van Duren wrote: > appl_agentx_free() closes any potential open sessions before closing the > connection and cleaning up. This function is called from multiple > contexts and the current APPL_CLOSE_REASONSHUTDOWN is not always > applicable. Add a se

Re: snmpd [5/16]: Check context existence in appl_agentx_recv

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 02:56:59PM +0200, Martijn van Duren wrote: > application.c checks the context where applicable, but not every > agentx-pdu goes through there (e.g. agentx-ping-pdu). Make sure > we always check the context in appl_agentx_recv() ok tb

Re: snmpd [4/16]: check agentx-pdu-header flags for validity

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 02:54:07PM +0200, Martijn van Duren wrote: > RFC2741 section 6.1 specifies which PDUs can contain which header flags. > Check that that incoming agentx PDUs have valid flags in > appl_agentx_recv(). While here I cleaned up a few log messages some > minor restructuring to pre

Re: relayd.conf.5: less SSL

2023-10-24 Thread Peter N. M. Hansteen
On Tue, Oct 24, 2023 at 06:54:30AM +, Klemens Nanni wrote: > - parse.y still accepting undocumented "ssl" with a warning since 2014 > - more "SSL/TLS" instead of "TLS" in manual and code comments my take would be that while it's fine to streamline the documentation to use the modern terminolog