<p><a href="https://gerrit.osmocom.org/c/osmo-sgsn/+/21960">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/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><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">cache_entry or cache_item would be more descriptive imho</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</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><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">would be great checking if TLLI is really there instead of directly de-referencing it.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">tlli is a mandatory field for SUSPEND/RESUME and in line 860 osmo_tlv_prot_parse would fail if any mandatory field isn't present.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Other branches skip these kind of checks as well.</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><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">same</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</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><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">FIX what?</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Replaced with todo for counter</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><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">static</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</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><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Probably worth avoid reescheduling it if the tlli cache is empty, and reenabling it when first item  […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Yeah, I thought about it as an optimization. I'll add a TODO for now</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><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">/* */</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</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><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I'd go or using timespec completely. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">We don't really need sub-second resolution anyway (and I changed the tlli_cache.timeout from timespec after a comment from Harald)</p><p style="white-space: pre-wrap; word-wrap: break-word;">https://gerrit.osmocom.org/c/osmo-sgsn/+/21960/1/include/osmocom/sgsn/gb_proxy.h#177</p><p style="white-space: pre-wrap; word-wrap: break-word;">I agree that comparing with timespec would probably be nicer here.</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: 4 </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: Mon, 11 Jan 2021 04:04:18 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>