osmo-mgw[master]: client: add ip address parsing to the client

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Oct 11 23:15:21 UTC 2017

Patch Set 6: Code-Review-1


-1 for space-indent, the rest is for you to reflect on.

File include/osmocom/mgcp_client/mgcp_client.h:

Line 39:         char audio_ip[INET_ADDRSTRLEN];
indent by tab, please

File src/libosmo-mgcp-client/mgcp_client.c:

Line 191: /* Parse a line like "c=IN IP4" */
(the line 'c=IN IP4' looks like it is more general than 'parse_audio_ip' ... is it semantically really tied to audio? Maybe also RTPC?)

Line 200: 	strcpy(r->audio_ip, line + 9);
should we check against

  c=IN IP4 and more nonsense


  c=IN IP4 not-an-ip-address-at-all


Is disallowing IP6 a conscious choice?

Also wondering ... are we losing the info whether the IP obtained in struct mgcp_response came from IP4 or IP6? Will we be able to derive this from the stored address str? Will we even care?

File tests/mgcp_client/mgcp_client_test.ok:

Line 31:   audio_ip =
hey, that's my office computer's IP! where'd you get that from? :)

To view, visit https://gerrit.osmocom.org/4147
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I44b338b09de45e1675cedf9737fa72dde72e979a
Gerrit-PatchSet: 6
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-HasComments: Yes

More information about the gerrit-log mailing list