<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/c/osmo-sgsn/+/21960">View Change</a></p><p>9 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/21960/3/include/osmocom/sgsn/gb_proxy.h">File include/osmocom/sgsn/gb_proxy.h:</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/osmo-sgsn/+/21960/3/include/osmocom/sgsn/gb_proxy.h@175">Patch Set #3, Line 175:</a> <code style="font-family:monospace,monospace">struct gbproxy_tlli_cache {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">cache_entry or cache_item would be more descriptive imho</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/21960/3/src/gbproxy/gb_proxy.c">File src/gbproxy/gb_proxy.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/osmo-sgsn/+/21960/3/src/gbproxy/gb_proxy.c@896">Patch Set #3, Line 896:</a> <code style="font-family:monospace,monospace">          tlli = osmo_load32be(TLVP_VAL(&tp, BSSGP_IE_TLLI));</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">would be great checking if TLLI is really there instead of directly de-referencing it.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/21960/3/src/gbproxy/gb_proxy.c@1164">Patch Set #3, Line 1164:</a> <code style="font-family:monospace,monospace">           uint32_t tlli = osmo_load32be(TLVP_VAL(&tp, BSSGP_IE_TLLI));</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">same</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/21960/3/src/gbproxy/gb_proxy.c@1170">Patch Set #3, Line 1170:</a> <code style="font-family:monospace,monospace">                    // FIXME</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">FIX what?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/21960/3/src/gbproxy/gb_proxy.c@1400">Patch Set #3, Line 1400:</a> <code style="font-family:monospace,monospace">void tlli_cache_cleanup(void *data)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">static</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/21960/3/src/gbproxy/gb_proxy.c@1405">Patch Set #3, Line 1405:</a> <code style="font-family:monospace,monospace">      osmo_timer_schedule(&cfg->tlli_cache.timer, 2, 0);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Probably worth avoid reescheduling it if the tlli cache is empty, and reenabling it when first item is added.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/21960/3/src/gbproxy/gb_proxy_peer.c">File src/gbproxy/gb_proxy_peer.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/osmo-sgsn/+/21960/3/src/gbproxy/gb_proxy_peer.c@270">Patch Set #3, Line 270:</a> <code style="font-family:monospace,monospace">               // Update the entry if it already exists</code></p><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/osmo-sgsn/+/21960/3/src/gbproxy/gb_proxy_peer.c@320">Patch Set #3, Line 320:</a> <code style="font-family:monospace,monospace">        expiry = now.tv_sec - cfg->tlli_cache.timeout;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I'd go or using timespec completely.<br>include <osmocom/core/timer_compat.h> and you have there all the timespeccmp, timespecsub, etc. available.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/21960/3/src/gbproxy/gb_proxy_peer.c@323">Patch Set #3, Line 323:</a> <code style="font-family:monospace,monospace">          if (tlli_cache->tstamp.tv_sec < expiry) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">timespeccmp</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/21960">change 21960</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-sgsn/+/21960"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sgsn </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I42adf70f560d2bb358a9e1c7614281e8d2967568 </div>
<div style="display:none"> Gerrit-Change-Number: 21960 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 08 Jan 2021 13:26:42 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>