Change in osmo-mgw[master]: mgcp_client: fix error handling in mgcp message generation

dexter gerrit-no-reply at
Fri Jun 11 13:16:45 UTC 2021

Hello Jenkins Builder, neels, laforge, pespin, fixeria, 

I'd like you to reexamine a change. Please visit

to look at the new patch set (#4).

Change subject: mgcp_client: fix error handling in mgcp message generation

mgcp_client: fix error handling in mgcp message generation

The functions add_lco and add_sdp assert when the codec string can not
be generated. This is the case when an unexpected codec is addressed in
the input parameter mgcp_msg for mgcp_msg_gen(). Even though the API
user is expected only to use the codec identifiers in mgcp_client.h the
check should not be done with an assert. Instead mgcp_msg_gen() should
just return NULL imediately.

Also all generation functions should not use magic numbers as return
codes. Instead constants from errno.h should be used. It is also
problematic that the return codes from msgb_printf are added up.
Depending. It makes more sense to use an OR operator since msgb_printf
only returns 0 or -EINVAL, so the end result will be -EINVAL if one or
more msgb_printf fail and not just a random negative value.

Change-Id: Ibb788343e0bec9c0eaf33e6e4727d4d36c100017
Related: OS#5119
M src/libosmo-mgcp-client/mgcp_client.c
M tests/mgcp_client/mgcp_client_test.err
2 files changed, 67 insertions(+), 48 deletions(-)

  git pull ssh:// refs/changes/82/24182/4
To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ibb788343e0bec9c0eaf33e6e4727d4d36c100017
Gerrit-Change-Number: 24182
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at>
Gerrit-Reviewer: laforge <laforge at>
Gerrit-Reviewer: neels <nhofmeyr at>
Gerrit-Reviewer: pespin <pespin at>
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list