<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/23983">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">xua_as_fsm: Only delete a route for an IPA AS if we created one earlier<br><br>The current code would potentially delete a route that was statically present in the<br>configuration in the following situation:<br><br>* route exists in config<br>* identical route is attempted to be added at AS-ACTIVE time, but fails<br>* route is unconditionally deleted at AS-DOWN time<br>* user now does 'write file' and has lost a route<br><br>Let's make sure we only delete the route if we added it previously.<br><br>Change-Id: I9ad5f7ebe0790e6c186b8ea1b12f204860a00cd2<br>Related: SYS#5422<br>---<br>M src/xua_as_fsm.c<br>1 file changed, 10 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/83/23983/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c</span><br><span>index f66ba88..c198f86 100644</span><br><span>--- a/src/xua_as_fsm.c</span><br><span>+++ b/src/xua_as_fsm.c</span><br><span>@@ -200,6 +200,7 @@</span><br><span>                 struct osmo_timer_list t_r;</span><br><span>          struct llist_head queued_msgs;</span><br><span>       } recovery;</span><br><span style="color: hsl(120, 100%, 40%);">+   bool ipa_route_created;</span><br><span> };</span><br><span> </span><br><span> /* is the given AS one with a single ASP of IPA type? */</span><br><span>@@ -227,9 +228,13 @@</span><br><span>         struct osmo_ss7_as *as = xafp->as;</span><br><span>        struct osmo_ss7_instance *inst = as->inst;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+     if (osmo_ss7_route_find_dpc_mask(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff))</span><br><span style="color: hsl(120, 100%, 40%);">+                return;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>    /* As opposed to M3UA, there is no RKM and we have to implicitly</span><br><span>      * automatically add a route once an IPA connection has come up */</span><br><span style="color: hsl(0, 100%, 40%);">-      osmo_ss7_route_create(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff, as->cfg.name);</span><br><span style="color: hsl(120, 100%, 40%);">+  if (osmo_ss7_route_create(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff, as->cfg.name))</span><br><span style="color: hsl(120, 100%, 40%);">+              xafp->ipa_route_created = true;</span><br><span> }</span><br><span> </span><br><span> static void ipa_del_route(struct osmo_fsm_inst *fi)</span><br><span>@@ -239,6 +244,10 @@</span><br><span>    struct osmo_ss7_instance *inst = as->inst;</span><br><span>        struct osmo_ss7_route *rt;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+        /* don't delete a route if we added none */</span><br><span style="color: hsl(120, 100%, 40%);">+       if (!xafp->ipa_route_created)</span><br><span style="color: hsl(120, 100%, 40%);">+              return;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>    /* find the route which we have created if we ever reached ipa_asp_fsm_wait_id_ack2 */</span><br><span>       rt = osmo_ss7_route_find_dpc_mask(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff);</span><br><span>      /* no route found, bail out */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/23983">change 23983</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/libosmo-sccp/+/23983"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-sccp </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I9ad5f7ebe0790e6c186b8ea1b12f204860a00cd2 </div>
<div style="display:none"> Gerrit-Change-Number: 23983 </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>