<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-hlr/+/16336">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gsup_server: send routing error back to the correct peer<br><br>If a peer attempts to add a route to an ipa-name that we already have in the<br>routing system, don't send the routing error to the peer that already has the<br>name, but to the peer that attempts to re-use it and would cause the collision.<br><br>This is fixing a situation where for example a locally attached MSC has name<br>'MSC-1', and a remote site is proxying GSUP here for a remote MSC that also has<br>the name 'MSC-1'. Send the routing error back to the proxy, not local 'MSC-1'.<br><br>Change-Id: Icafaedc11b5925149d338bdcb987ae985a7323d6<br>---<br>M src/gsup_server.c<br>1 file changed, 9 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/36/16336/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gsup_server.c b/src/gsup_server.c</span><br><span>index 0071827..5c5f917 100644</span><br><span>--- a/src/gsup_server.c</span><br><span>+++ b/src/gsup_server.c</span><br><span>@@ -69,7 +69,15 @@</span><br><span>       struct msgb *msg = osmo_gsup_msgb_alloc("GSUP Tx");</span><br><span>        int rc;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-     conn = gsup_route_find_gt(server, &req->source_name);</span><br><span style="color: hsl(120, 100%, 40%);">+  if (response->message_type == OSMO_GSUP_MSGT_ROUTING_ERROR</span><br><span style="color: hsl(120, 100%, 40%);">+     && req->via_proxy.len) {</span><br><span style="color: hsl(120, 100%, 40%);">+               /* If a routing error occured, we need to route back via the immediate sending peer, not via the</span><br><span style="color: hsl(120, 100%, 40%);">+               * intended final recipient -- because one source of routing errors is a duplicate name for a recipient.</span><br><span style="color: hsl(120, 100%, 40%);">+               * If we resolve to req->source_name, we may send to a completely unrelated recipient. */</span><br><span style="color: hsl(120, 100%, 40%);">+          conn = gsup_route_find_gt(server, &req->via_proxy);</span><br><span style="color: hsl(120, 100%, 40%);">+    } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              conn = gsup_route_find_gt(server, &req->source_name);</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span>    if (!conn) {</span><br><span>                 LOG_GSUP_REQ(req, LOGL_ERROR, "GSUP client that sent this request was disconnected, cannot respond\n");</span><br><span>            msgb_free(msg);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-hlr/+/16336">change 16336</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-hlr/+/16336"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-hlr </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Icafaedc11b5925149d338bdcb987ae985a7323d6 </div>
<div style="display:none"> Gerrit-Change-Number: 16336 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>