<p>dexter <strong>uploaded patch set #4</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/24182">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mgcp_client: fix error handling in mgcp message generation<br><br>The functions add_lco and add_sdp assert when the codec string can not<br>be generated. This is the case when an unexpected codec is addressed in<br>the input parameter mgcp_msg for mgcp_msg_gen(). Even though the API<br>user is expected only to use the codec identifiers in mgcp_client.h the<br>check should not be done with an assert. Instead mgcp_msg_gen() should<br>just return NULL imediately.<br><br>Also all generation functions should not use magic numbers as return<br>codes. Instead constants from errno.h should be used. It is also<br>problematic that the return codes from msgb_printf are added up.<br>Depending. It makes more sense to use an OR operator since msgb_printf<br>only returns 0 or -EINVAL, so the end result will be -EINVAL if one or<br>more msgb_printf fail and not just a random negative value.<br><br>Change-Id: Ibb788343e0bec9c0eaf33e6e4727d4d36c100017<br>Related: OS#5119<br>---<br>M src/libosmo-mgcp-client/mgcp_client.c<br>M tests/mgcp_client/mgcp_client_test.err<br>2 files changed, 67 insertions(+), 48 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/82/24182/4</pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-mgw/+/24182">change 24182</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-mgw/+/24182"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-mgw </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ibb788343e0bec9c0eaf33e6e4727d4d36c100017 </div>
<div style="display:none"> Gerrit-Change-Number: 24182 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>