<p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/14768">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/14768/1/src/osmo-bsc/neighbor_ident_vty.c">File src/osmo-bsc/neighbor_ident_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/14768/1/src/osmo-bsc/neighbor_ident_vty.c@392">Patch Set #1, Line 392:</a> <code style="font-family:monospace,monospace">static int del_all(struct vty *vty)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">let's make this a bit more descriptive like neighbor_del_all, neigh_del_all, bts_remove_all_neighbors, or the like.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/14768/1/src/osmo-bsc/neighbor_ident_vty.c@397">Patch Set #1, Line 397:</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;"><br>  if (vty->node != BTS_NODE) {<br>               vty_out(vty, "%% Error: cannot remove BTS neighbor, not on BTS node%s",<br>                     VTY_NEWLINE);<br>         return CMD_WARNING;<br>   }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I would actually OSMO_ASSERT here, as this would mean that the VTY command was registered to the wrong node, a clear "must not happen" situation.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/14768/1/src/osmo-bsc/neighbor_ident_vty.c@403">Patch Set #1, Line 403:</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;">if (!bts) {<br>               vty_out(vty, "%% Error: cannot remove BTS neighbor, no BTS on this node%s",<br>                 VTY_NEWLINE);<br>         return CMD_WARNING;<br>   }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">it's arguable whether the removal of 0 neighbors is successful or an error (warning esentially is the error, as they only altrenative is CMD_FATAL which terminates the process).</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/14768/1/src/osmo-bsc/neighbor_ident_vty.c@410">Patch Set #1, Line 410:</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;">while (1) {<br>             struct gsm_bts_ref *neigh = llist_first_entry_or_null(&bts->local_neighbors, struct gsm_bts_ref, entry);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">why are we not using llist_for_each_entry() here? It seems more natural to me.  Actually, as we are deleting members, llist_for_each_entry_safe() would be the more "natural" choice here.  Using while(1) loops always makes me twitchy, for the off chance they could never terminate...</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/14768">change 14768</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-bsc/+/14768"/><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-Change-Id: I8623ab581639e9f8af6a9ff1eca990518d1b1211 </div>
<div style="display:none"> Gerrit-Change-Number: 14768 </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-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-CC: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Sun, 14 Jul 2019 00:17:18 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>