fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42294?usp=email )
Change subject: s1ap_proxy: fix discarded result of handle_ies/3 in HO REQ ACK handler
......................................................................
s1ap_proxy: fix discarded result of handle_ies/3 in HO REQ ACK handler
The call processing the optional E-RABFailedToSetupListHOReqAck IE did
not pattern-match its return value, causing any errors returned by
handle_ies/3 to be silently swallowed. Bind the result to {_, S2}
to make the intent explicit.
Change-Id: I1c8feeb63fe23876ae443784980e9dc22a450c54
---
M src/s1ap_proxy.erl
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl
index a29a817..ef7665e 100644
--- a/src/s1ap_proxy.erl
+++ b/src/s1ap_proxy.erl
@@ -604,8 +604,8 @@
end,
%% handle the (optional) list of failed E-RABs
%% no #proxy_state modification is expected here
- handle_ies(?'id-E-RABFailedToSetupListHOReqAck',
- C0#'HandoverRequestAcknowledge'.protocolIEs, S2),
+ {_, S2} = handle_ies(?'id-E-RABFailedToSetupListHOReqAck',
+ C0#'HandoverRequestAcknowledge'.protocolIEs, S2),
{Result, S2};
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42294?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I1c8feeb63fe23876ae443784980e9dc22a450c54
Gerrit-Change-Number: 42294
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42296?usp=email )
Change subject: enb_registry: fix pattern match in handle_info 'DOWN' handler
......................................................................
enb_registry: fix pattern match in handle_info 'DOWN' handler
PIDs maps pid() => enb_handle() (an integer), so maps:find/2 returns
{ok, SomeHandle}. The old pattern {ok, Pid} tried to match an integer
against the already-bound pid() variable, which never succeeds.
This handler is only called on abnormal termination (process crash),
so the broken match caused the registry entry to never be cleaned up
in that case. Fix by using a fresh {ok, Handle} binding and removing
the now-redundant follow-up maps:get/2 call.
Change-Id: I4cb044e8071c4ae2fc48c507f8733af6c617ec46
---
M src/enb_registry.erl
1 file changed, 1 insertion(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/enb_registry.erl b/src/enb_registry.erl
index 54eca5d..d2487a0 100644
--- a/src/enb_registry.erl
+++ b/src/enb_registry.erl
@@ -257,8 +257,7 @@
pids = PIDs} = S) ->
?LOG_INFO("eNB process (pid=~p) terminated with reason ~p", [Pid, Reason]),
case maps:find(Pid, PIDs) of
- {ok, Pid} ->
- Handle = maps:get(Pid, PIDs),
+ {ok, Handle} ->
enb_metrics_reset(maps:get(Handle, ENBs)),
?LOG_INFO("eNB (handle=~p, pid=~p) has been unregistered", [Handle, Pid]),
{noreply, S#state{enbs = maps:remove(Handle, ENBs),
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42296?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I4cb044e8071c4ae2fc48c507f8733af6c617ec46
Gerrit-Change-Number: 42296
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42297?usp=email )
Change subject: enb_registry: fix duplicate registration check in enb_register/0
......................................................................
enb_registry: fix duplicate registration check in enb_register/0
next_handle was bound in the function head and reused in the case
pattern {ok, Handle}, turning what looks like a binding into an
equality test against next_handle. The duplicate check therefore
only fired if the previously assigned handle happened to equal the
current next_handle counter, which is essentially never true.
Fix by removing next_handle from the function head pattern and reading
it with S#state.next_handle inside the error branch, so that Handle in
{ok, Handle} is always a fresh binding that matches any existing handle.
Change-Id: Ia64f3e2e79bea055e5c37df9bce91a4bcbf7184c
---
M src/enb_registry.erl
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/src/enb_registry.erl b/src/enb_registry.erl
index d2487a0..29a2575 100644
--- a/src/enb_registry.erl
+++ b/src/enb_registry.erl
@@ -155,13 +155,13 @@
handle_call(enb_register,
{Pid, _Tag},
#state{enbs = ENBs,
- pids = PIDs,
- next_handle = Handle} = S) ->
+ pids = PIDs} = S) ->
case maps:find(Pid, PIDs) of
{ok, Handle} ->
?LOG_ERROR("eNB (handle=~p, pid=~p) is *already* registered", [Handle, Pid]),
{reply, {error, already_registered}, S};
error ->
+ Handle = S#state.next_handle,
%% keep an eye on the process being registered
MonRef = erlang:monitor(process, Pid),
%% create and store an initial eNB state
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42297?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: Ia64f3e2e79bea055e5c37df9bce91a4bcbf7184c
Gerrit-Change-Number: 42297
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>