OpenBSD CVS

CVS log for src/usr.sbin/snmpd/application_agentx.c


[BACK] Up to [local] / src / usr.sbin / snmpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.16 / (download) - annotate - [select for diffs], Tue Feb 6 12:44:27 2024 UTC (3 months, 3 weeks ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.15: +3 -2 lines
Diff to previous 1.15 (colored)

Replace most smi_oid2string() calls with the new mib_oid2string().
smi_oid2string() is still called from trap handle context to not break
any existing scripts.

OK tb@

Revision 1.15 / (download) - annotate - [select for diffs], Thu Dec 21 12:43:30 2023 UTC (5 months, 1 week ago) by martijn
Branch: MAIN
Changes since 1.14: +5 -4 lines
Diff to previous 1.14 (colored)

Clean up snmpd's header situation.

With the help of tb@ and include-what-you-use.

OK tb@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Nov 6 11:04:41 2023 UTC (6 months, 3 weeks ago) by martijn
Branch: MAIN
Changes since 1.13: +58 -5 lines
Diff to previous 1.13 (colored)

Hook up agentx-{Add,Remove}AgentCaps-PDU to appl_{add,remove}agentcaps.

OK tb@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Oct 27 10:23:58 2023 UTC (7 months ago) by martijn
Branch: MAIN
Changes since 1.12: +17 -15 lines
Diff to previous 1.12 (colored)

Use event_add(), instead of calling appl_agentx_send() directly. If an
error occurs the connection will be freed and if the caller uses the
connection afterwards it will lead to a use after free.

OK tb@

Revision 1.12 / (download) - annotate - [select for diffs], Tue Oct 24 14:11:14 2023 UTC (7 months, 1 week ago) by martijn
Branch: MAIN
Changes since 1.11: +2 -1 lines
Diff to previous 1.11 (colored)

set ab_range explicitly to 1 for appl_agentx_session instead of relying
on malloc random garbage.

OK tb@

Revision 1.11 / (download) - annotate - [select for diffs], Tue Oct 24 14:02:52 2023 UTC (7 months, 1 week ago) by martijn
Branch: MAIN
Changes since 1.10: +7 -1 lines
Diff to previous 1.10 (colored)

When opening 2 sessions on an agentx connection and registering 2
overlapping regions on the different sessions, e.g. by differing in
priority and we close the underlying connection with an outstanding
request to the dominant region we will call appl_agentx_free(), which
sequentially closes all sessions. If the session with the outstanding
request is closed before the second session the request is retried
before said session is cleaned up and it will try to send it over a
conn_ax which at that point has been set to NULL, resulting in a
SIGSEGV.

Simply return early and let this second request be cancelled by the
cleanup of the second session.

OK tb@

Revision 1.10 / (download) - annotate - [select for diffs], Tue Oct 24 13:41:16 2023 UTC (7 months, 1 week ago) by martijn
Branch: MAIN
Changes since 1.9: +18 -5 lines
Diff to previous 1.9 (colored)

RFC2741 section 6.2.2 says that reasonByManager can only be used by the
agentx master. Treat this reason as a parseerror.

OK tb@

Revision 1.9 / (download) - annotate - [select for diffs], Tue Oct 24 13:37:02 2023 UTC (7 months, 1 week ago) by martijn
Branch: MAIN
Changes since 1.8: +10 -8 lines
Diff to previous 1.8 (colored)

appl_agentx_free() closes any open sessions before freeing everything up.
Up until now all sessions were closed with reasonShutdown, which is not
accurate for every situation. Give it an additional reason argument that
propagates to appl_agentx_forceclose().

OK tb@

Revision 1.8 / (download) - annotate - [select for diffs], Tue Oct 24 13:28:11 2023 UTC (7 months, 1 week ago) by martijn
Branch: MAIN
Changes since 1.7: +7 -1 lines
Diff to previous 1.7 (colored)

Always check if the context is available inside appl_agentx_recv().
Not every PDU goes through application.c.

OK tb@

Revision 1.7 / (download) - annotate - [select for diffs], Tue Oct 24 12:57:40 2023 UTC (7 months, 1 week ago) by martijn
Branch: MAIN
Changes since 1.6: +79 -29 lines
Diff to previous 1.6 (colored)

Verify if supplied AgentX PDU header flags are valid for given PDU type
inside appl_agentx_recv().
While here clean up the logging a bit.

OK tb@

Revision 1.6 / (download) - annotate - [select for diffs], Tue Oct 24 09:00:53 2023 UTC (7 months, 1 week ago) by martijn
Branch: MAIN
Changes since 1.5: +9 -2 lines
Diff to previous 1.5 (colored)

RFC2741 section 7.1.1 tells us that if a pdu can't be parsed we must
return a parseerror. Make sure we can differentiate between parseerror and
openfailed.

OK tb@

Revision 1.5 / (download) - annotate - [select for diffs], Tue Oct 24 08:54:52 2023 UTC (7 months, 1 week ago) by martijn
Branch: MAIN
Changes since 1.4: +15 -17 lines
Diff to previous 1.4 (colored)

According to RFC2741 section 6.1.1 an agentx-response-pdu shouldn't have
the NON_DEFAULT_CONTEXT set. Remove the argument from ax_response().

OK tb@

Revision 1.4 / (download) - annotate - [select for diffs], Thu Sep 1 14:34:17 2022 UTC (21 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.3: +43 -3 lines
Diff to previous 1.3 (colored)

Add privilege separation to snmpd.

This uses the just imported snmpd_metrics as a new (agentx-based) backend.
Snmpd(8) executes all files in /usr/libexec/snmpd and treats regions
registered by these binaries as authorative, so that no other agentx
backends can overwrite them. The snmpe process is now pledged
"stdio recvfd inet unix".

This removes quite a few entries from the sysORTable, but the current
entries are non-compliant anyway and should be completely revisisted at a
later time.

Reduces the time for a full walk by about a factor of 4, bringing us close
to the original speed before application.c was introduced.

General design discussed with claudio@
Tested by and OK sthen
Release build test and OK tb@

Revision 1.3 / (download) - annotate - [select for diffs], Tue Aug 30 14:54:18 2022 UTC (21 months ago) by martijn
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

copy over av_oid_end.bo_n instead of av_oid.bo_n bytes when copying over
the searchrange end oid.

OK tb@

Revision 1.2 / (download) - annotate - [select for diffs], Mon Aug 29 18:10:48 2022 UTC (21 months ago) by martijn
Branch: MAIN
Changes since 1.1: +4 -4 lines
Diff to previous 1.1 (colored)

Clean up a couple of log lines.

OK tb@

Revision 1.1 / (download) - annotate - [select for diffs], Tue Aug 23 08:56:20 2022 UTC (21 months, 1 week ago) by martijn
Branch: MAIN

(Re)add support for agentx in snmpd
Current omissions in protocol support are notifications,
index (de)allocation, and agent capabilities.

Help testing sthen@
Feedback/tweaks/OK jmatthew@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.