Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
1161-snmp-Handle-failed-vacm-lookup.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1161-snmp-Handle-failed-vacm-lookup.patch of Package erlang
From 36c391a01f70840cb01281c7ef1ebb7a48bd55a0 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Tue, 3 Jan 2023 18:10:07 +0100 Subject: [PATCH 1/2] [snmp] Handle failed vacm lookup Handle when we fail to lookup info (mask, type and status) from the vacmViewTreeFamilyTable table. If this happens, we will throw noSuchView (instead of crashing). OTP-18379 --- lib/snmp/src/agent/snmpa_vacm.erl | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/snmp/src/agent/snmpa_vacm.erl b/lib/snmp/src/agent/snmpa_vacm.erl index d7d588c30d..93850c31a6 100644 --- a/lib/snmp/src/agent/snmpa_vacm.erl +++ b/lib/snmp/src/agent/snmpa_vacm.erl @@ -142,12 +142,16 @@ split_prefix(_, _) -> false. %% ViewName is including length from now on loop_mib_view(ViewName, Subtree, Indexes, MibView) -> - [{value, Mask}, {value, Type}, {value, Status}] = - snmp_view_based_acm_mib:vacmViewTreeFamilyTable( - get, Indexes, - [?vacmViewTreeFamilyMask, - ?vacmViewTreeFamilyType, - ?vacmViewTreeFamilyStatus]), + {Mask, Type, Status} = + case loop_mib_view_get(Indexes) of + [{value, M}, {value, T}, {value, S}] -> + {M, T, S}; + Else -> + ?vinfo("Failed vacmViewTreeFamilyTable lookup:" + "~n Indexes: ~p" + "~n Result: ~p", [Indexes, Else]), + exit(noSuchView) + end, NextMibView = case Status of ?'RowStatus_active' -> @@ -169,6 +173,13 @@ loop_mib_view(ViewName, Subtree, Indexes, MibView) -> end end. +loop_mib_view_get(Indexes) -> + Cols = [?vacmViewTreeFamilyMask, + ?vacmViewTreeFamilyType, + ?vacmViewTreeFamilyStatus], + snmp_view_based_acm_mib:vacmViewTreeFamilyTable(get, Indexes, Cols). + + %%%----------------------------------------------------------------- %%% 1b. The ordered ets table that implements vacmAccessTable %%%----------------------------------------------------------------- -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor