<p>Patch set 3:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.osmocom.org/11552">View Change</a></p><p>8 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/11552/3/src/osmo-bsc/osmo_bsc_lcls.c">File src/osmo-bsc/osmo_bsc_lcls.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11552/3/src/osmo-bsc/osmo_bsc_lcls.c@238">Patch Set #3, Line 238:</a> <code style="font-family:monospace,monospace">    uint16_t port = enable ? conn->lcls.other->lchan->abis_ip.bound_port : lchan->abis_ip.connect_port;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">(may I suggest comments...</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  if (enable) {<br>    /* redirect directly to remote BTS's IP:port */<br>    ...<br>  } else {<br>    /* redirect back to the MGW's IP:port */<br>    ...<br>  }</pre><p style="white-space: pre-wrap; word-wrap: break-word;">)</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11552/3/src/osmo-bsc/osmo_bsc_lcls.c@240">Patch Set #3, Line 240:</a> <code style="font-family:monospace,monospace">  if (conn->lcls.other) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">(may I suggest early-exit coding style...</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  if (!conn->lcls.other) {<br>    err handling<br>    return;<br>  }</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  normal case</pre><p style="white-space: pre-wrap; word-wrap: break-word;">)</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11552/3/src/osmo-bsc/osmo_bsc_lcls.c@243">Patch Set #3, Line 243:</a> <code style="font-family:monospace,monospace">             LOGPFSM(conn->lcls.fi, "LCLS conn other is unavailable for %s!\n", enable ? "enable" : "disable");</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">hmm, maybe: "%s LCLS: other conn is not available\n"</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11552/3/src/osmo-bsc/osmo_bsc_lcls.c@244">Patch Set #3, Line 244:</a> <code style="font-family:monospace,monospace">             return;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">is there no error handling? what happens if this fails, the LCLS state thinks the loop is closed but it actually isn't?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11552/3/src/osmo-bsc/osmo_bsc_lcls.c@247">Patch Set #3, Line 247:</a> <code style="font-family:monospace,monospace">    abis_rsl_sendmsg(msg);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">evaluate rc and roll back LCLS state on error? Or even tear down conn if we can't send RSL?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11552/3/src/osmo-bsc/osmo_bsc_lcls.c@295">Patch Set #3, Line 295:</a> <code style="font-family:monospace,monospace">         lcls_rsl(conn, false);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I would prefer a full-on switch() statement, making sure we cover all enum values, and catch wrongly initialized values.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11552/3/src/osmo-bsc/osmo_bsc_lcls.c@648">Patch Set #3, Line 648:</a> <code style="font-family:monospace,monospace">                lcls_rsl(conn, true);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">switch()</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/11552/3/src/osmo-bsc/osmo_bsc_vty.c">File src/osmo-bsc/osmo_bsc_vty.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11552/3/src/osmo-bsc/osmo_bsc_vty.c@653">Patch Set #3, Line 653:</a> <code style="font-family:monospace,monospace">      "Enable LCLS with loopping traffic between BTS\n")</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">"looping". In this case I'd be fine to fix the typo in the previous code at the same time.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/11552">change 11552</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/11552"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I7e8379f31037f2c48da69a01919701919a3066a2 </div>
<div style="display:none"> Gerrit-Change-Number: 11552 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 05 Nov 2018 03:24:57 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>