Change in osmo-mgw[master]: trunk: parse E1 trunk number

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Mon Jun 22 13:16:00 UTC 2020


dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/18752 )

Change subject: trunk: parse E1 trunk number
......................................................................


Patch Set 7:

(4 comments)

> Patch Set 6:
> 
> (2 comments)

https://gerrit.osmocom.org/c/osmo-mgw/+/18752/5/src/libosmo-mgcp/mgcp_trunk.c 
File src/libosmo-mgcp/mgcp_trunk.c:

https://gerrit.osmocom.org/c/osmo-mgw/+/18752/5/src/libosmo-mgcp/mgcp_trunk.c@142 
PS5, Line 142: 		if (errno == ERANGE || trunk_nr > 64 || trunk_nr == 0)
> I recommended checking existing uses of strtoul in osmo-mgw since correctness checking is a bit tric […]
I did, I hope its now better. Why (errno == ERANGE && pt == ULONG_MAX), is it not enough it errno is at ERANGE?


https://gerrit.osmocom.org/c/osmo-mgw/+/18752/5/src/libosmo-mgcp/mgcp_trunk.c@142 
PS5, Line 142: 		if (errno == ERANGE || trunk_nr > 64 || trunk_nr == 0)
> I recommended checking existing uses of strtoul in osmo-mgw since correctness checking is a bit tric […]
Done


https://gerrit.osmocom.org/c/osmo-mgw/+/18752/6/src/libosmo-mgcp/mgcp_trunk.c 
File src/libosmo-mgcp/mgcp_trunk.c:

https://gerrit.osmocom.org/c/osmo-mgw/+/18752/6/src/libosmo-mgcp/mgcp_trunk.c@142 
PS6, Line 142: 		trunk_nr = strtoul(epname + prefix_len, &str_trunk_nr_end, 10);
> you are missing setting errno = 0 prior to calling it.
Done


https://gerrit.osmocom.org/c/osmo-mgw/+/18752/6/src/libosmo-mgcp/mgcp_trunk.c@143 
PS6, Line 143: 		if (errno == ERANGE || trunk_nr > 64 || trunk_nr == 0
> if ((errno == ERANGE && pt == ULONG_MAX) || (errno && !trunk_nr) || […]
yes, this is expected. The trunk numbers are not freely assignable. Trunk 0 is bound to the virtual trunk. 1-64 can be E1 trunks. (I am not happy yet with the method how the trunk gets resolved, especially the exception below is a mess.)



-- 
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/18752
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ifdaab953544151e73b58cc3e95d21afdb40765f4
Gerrit-Change-Number: 18752
Gerrit-PatchSet: 7
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-Comment-Date: Mon, 22 Jun 2020 13:16:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin at sysmocom.de>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200622/c191251b/attachment.htm>


More information about the gerrit-log mailing list