<p><a href="https://gerrit.osmocom.org/11656">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/11656/1/src/gprs/gprs_sndcp_xid.c">File src/gprs/gprs_sndcp_xid.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/11656/1/src/gprs/gprs_sndcp_xid.c@538">Patch Set #1, Line 538:</a> <code style="font-family:monospace,monospace">               return SNDCP_XID_INVALID_COMPRESSION;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">before, there is a comparison " != -1" replaced with " != SNDCP_XID_INVALID_COMPRESSION". […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Good point. See https://gerrit.osmocom.org/c/osmo-sgsn/+/11730</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11656/1/src/gprs/gprs_sndcp_xid.c@1299">Patch Set #1, Line 1299:</a> <code style="font-family:monospace,monospace">         return SNDCP_XID_INVALID_COMPRESSION;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">not sure whether this makes sense. Above and below, -EINVAL is returned or a length when successful.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Indeed, that change is wrong.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11656/1/src/gprs/gprs_sndcp_xid.c@1444">Patch Set #1, Line 1444:</a> <code style="font-family:monospace,monospace">         if (compclass != SNDCP_XID_INVALID_COMPRESSION) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">It's a bit awkward to follow this logic, both before and after this patch. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Before this patch, algo was set to -EINVAL on error in gprs_sndcp_get_compression_class().<br>I believe this is what this condition is supposed to check for.<br>List elements with algo -EINVAL are skipped silently.<br>Elements with an invalid compression class result in an erorr.</p><p style="white-space: pre-wrap; word-wrap: break-word;">In the new code, algo is set to INVALID_COMPRESSION instead of -EINVAL upon error.<br>Also, we now need to know the compression class before reading the algorithm,<br>because the algo is now stored in a union and we select union members based on<br>the compression class.<br>But overall, I believe the new code keeps the existing behaviour intact.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I will tweak this slightly in the next patch set to avoid nesting the<br>switch-statement inside an if-statement.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/11656/1/src/gprs/gprs_sndcp_xid.c@1474">Patch Set #1, Line 1474:</a> <code style="font-family:monospace,monospace">        compclass = gprs_sndcp_get_compression_class(comp_field_dst);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">what is the relation between gprs_sndcp_get_compression_class() and the gprs_sndcp_comp. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I sort of see what you're getting at but I don't see how to make it any better without blowing up the size of this patch even further.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/11656">change 11656</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/11656"/><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-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I3771a5c59f4e6fee24083b3c914965baf192cbd7 </div>
<div style="display:none"> Gerrit-Change-Number: 11656 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Stefan Sperling <ssperling@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: Stefan Sperling <ssperling@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 12 Nov 2018 14:26:59 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>