<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-remsim/+/16489">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bankd: Reject removeSlotmap when ClientID doesn't match<br><br>It's a bit of a matter of taste whether we should simply log + ignore<br>if the Client of a removeMappingReq doesn't match what the bankd<br>currently has configured.  I chose to reject it, as a new createMapping<br>for the same bandk+slot will overwrite any existing mapping anyway,<br>at least as of I83e319d22896b881c0d882542842f500075aa546<br><br>Change-Id: I892282821f4650614d1d08ed4bdf11eaabf947c0<br>---<br>M src/bankd/bankd_main.c<br>1 file changed, 9 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/89/16489/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c</span><br><span>index 03101fb..94227e3 100644</span><br><span>--- a/src/bankd/bankd_main.c</span><br><span>+++ b/src/bankd/bankd_main.c</span><br><span>@@ -217,9 +217,15 @@</span><br><span>                          LOGPFSML(srvc->fi, LOGL_ERROR, "could not find to-be-deleted slotmap\n");</span><br><span>                               resp = rspro_gen_RemoveMappingRes(ResultCode_unknownSlotmap);</span><br><span>                        } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                                LOGPFSM(srvc->fi, "removing slotmap\n");</span><br><span style="color: hsl(0, 100%, 40%);">-                           bankd_srvc_remove_mapping(map);</span><br><span style="color: hsl(0, 100%, 40%);">-                         resp = rspro_gen_RemoveMappingRes(ResultCode_ok);</span><br><span style="color: hsl(120, 100%, 40%);">+                             rspro2client_slot(&cs, &rreq->client);</span><br><span style="color: hsl(120, 100%, 40%);">+                             if (!client_slot_equals(&map->client, &cs)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                      LOGPFSM(srvc->fi, "ClientId in removeMappingReq != map\n");</span><br><span style="color: hsl(120, 100%, 40%);">+                                      resp = rspro_gen_RemoveMappingRes(ResultCode_unknownSlotmap);</span><br><span style="color: hsl(120, 100%, 40%);">+                         } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                                      LOGPFSM(srvc->fi, "removing slotmap\n");</span><br><span style="color: hsl(120, 100%, 40%);">+                                 bankd_srvc_remove_mapping(map);</span><br><span style="color: hsl(120, 100%, 40%);">+                                       resp = rspro_gen_RemoveMappingRes(ResultCode_ok);</span><br><span style="color: hsl(120, 100%, 40%);">+                             }</span><br><span>                    }</span><br><span>            }</span><br><span>            server_conn_send_rspro(srvc, resp);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-remsim/+/16489">change 16489</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-remsim/+/16489"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-remsim </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I892282821f4650614d1d08ed4bdf11eaabf947c0 </div>
<div style="display:none"> Gerrit-Change-Number: 16489 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>