<p>Neels Hofmeyr has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10119">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fix 3G hack: allow any IP for loopback and 0.0.0.0<br><br>HACK: for IuUP, we want to reply with an IuUP Initialization ACK upon the first RTP<br>message received. We currently hackishly accomplish that by putting the endpoint in<br>loopback mode and patching over the looped back RTP message to make it look like an<br>ack. We don't know the femto cell's IP address and port until the RAB Assignment<br>Response is received, but the nano3G expects an IuUP Initialization Ack before it even<br>sends the RAB Assignment Response. Hence, if the remote address is 0.0.0.0 and the<br>MGCP port is in loopback mode, allow looping back the packet to any source.<br><br>None of these are anything near nice, during call setup using a 3G femto cell,<br>we still lack a proper IuUP handling. See OS#2459, OS#1937. This is merely a<br>temporary hack to maintain 3G voice usability in a quick and dirty way.<br><br>Related: OS#3411<br>Change-Id: Ib25e6261855eae8ddb8d1c0b8838cc3e30332cf1<br>---<br>M src/libosmo-mgcp/mgcp_network.c<br>1 file changed, 16 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/19/10119/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c</span><br><span>index 3ac93be..6884db9 100644</span><br><span>--- a/src/libosmo-mgcp/mgcp_network.c</span><br><span>+++ b/src/libosmo-mgcp/mgcp_network.c</span><br><span>@@ -829,6 +829,22 @@</span><br><span> {</span><br><span>         struct mgcp_endpoint *endp;</span><br><span>  endp = conn->conn->endp;</span><br><span style="color: hsl(120, 100%, 40%);">+        struct sockaddr_in zero_addr = {};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  if (memcmp(&zero_addr, &conn->end.addr, sizeof(zero_addr)) == 0</span><br><span style="color: hsl(120, 100%, 40%);">+        && conn->conn->mode == MGCP_CONN_LOOPBACK) {</span><br><span style="color: hsl(120, 100%, 40%);">+                /* HACK: for IuUP, we want to reply with an IuUP Initialization ACK upon the first RTP</span><br><span style="color: hsl(120, 100%, 40%);">+                 * message received. We currently hackishly accomplish that by putting the endpoint in</span><br><span style="color: hsl(120, 100%, 40%);">+                 * loopback mode and patching over the looped back RTP message to make it look like an</span><br><span style="color: hsl(120, 100%, 40%);">+                 * ack. We don't know the femto cell's IP address and port until the RAB Assignment</span><br><span style="color: hsl(120, 100%, 40%);">+            * Response is received, but the nano3G expects an IuUP Initialization Ack before it even</span><br><span style="color: hsl(120, 100%, 40%);">+              * sends the RAB Assignment Response. Hence, if the remote address is 0.0.0.0 and the</span><br><span style="color: hsl(120, 100%, 40%);">+          * MGCP port is in loopback mode, allow looping back the packet to any source. */</span><br><span style="color: hsl(120, 100%, 40%);">+             LOGP(DRTP, LOGL_ERROR,</span><br><span style="color: hsl(120, 100%, 40%);">+                     "endpoint:0x%x In loopback mode and remote address not set: allowing data from address: %s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+              ENDPOINT_NUMBER(endp), inet_ntoa(addr->sin_addr));</span><br><span style="color: hsl(120, 100%, 40%);">+            return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span> </span><br><span>        /* Note: Check if the inbound RTP data comes from the same host to</span><br><span>    * which we send our outgoing RTP traffic. */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10119">change 10119</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/10119"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-mgw </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ib25e6261855eae8ddb8d1c0b8838cc3e30332cf1 </div>
<div style="display:none"> Gerrit-Change-Number: 10119 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>