<p>Patch set 1:<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/11493">View Change</a></p><p>4 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/11493/1/src/osmo-bsc/bsc_vty.c">File src/osmo-bsc/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/11493/1/src/osmo-bsc/bsc_vty.c@544">Patch Set #1, Line 544:</a> <code style="font-family:monospace,monospace">show rejected</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think in terms of naming this needs to be further qualified.  "show rejected-bts"?  "show rejected-oml"? Many things can be rejected at many different levels, so just "reejcted" is a bit too generic.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/11493/1/src/osmo-bsc/bts_ipaccess_nanobts.c">File src/osmo-bsc/bts_ipaccess_nanobts.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/11493/1/src/osmo-bsc/bts_ipaccess_nanobts.c@475">Patch Set #1, Line 475:</a> <code style="font-family:monospace,monospace">64</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I've seen this magic number appearing two times now.  I think this warrants a #define, probably next to the osmo_sock_get_remote* which specifies the maximum required buffer size for those kind of buffers.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Also, we generally declare all variables at the top of the block, so it should be declared at the line below 'uint16_t trx_id'.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11493/1/src/osmo-bsc/bts_ipaccess_nanobts.c@480">Patch Set #1, Line 480:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">struct gsm_bts_rejected *entry = NULL;<br>        struct gsm_bts_rejected *pos;<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">same for those variables, they should be at the top of the block.  Or you split the block into a separate function like "rejected_bts_find(site_id, bts_id, ip)" which then has those variables as local variables in the scope of that function.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11493/1/src/osmo-bsc/bts_ipaccess_nanobts.c@506">Patch Set #1, Line 506:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">llist_for_each_entry(pos, &bsc_gsmnet->bts_rejected, list) {<br>         if (i >= 25)<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">we do have llist_count() to count the number of entries. So you culd do something like for (i = llist_count(); i > 25; i--) { }</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/11493">change 11493</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/11493"/><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: Iba3bfe8fc9432b7ae8f819df8bd71b35b3ec507e </div>
<div style="display:none"> Gerrit-Change-Number: 11493 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 29 Oct 2018 23:06:48 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>