pespin has submitted this change. (
https://gerrit.osmocom.org/c/libosmo-sigtran/+/43384?usp=email )
Change subject: ss7_instance: Only call osmo_ss7_pc_width() when needed
......................................................................
ss7_instance: Only call osmo_ss7_pc_width() when needed
Change-Id: Ie0728cef36c1cbeb755baef105f3ab88d025db01
---
M src/ss7_instance.c
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/src/ss7_instance.c b/src/ss7_instance.c
index 05f6be8..b349974 100644
--- a/src/ss7_instance.c
+++ b/src/ss7_instance.c
@@ -671,15 +671,15 @@
int osmo_ss7_pointcode_parse_mask_or_len(const struct osmo_ss7_instance *inst,
const char *in)
{
- unsigned int width = osmo_ss7_pc_width(inst ? &inst->cfg.pc_fmt :
&default_pc_fmt);
-
if (in[0] == '/') {
/* parse mask by length */
+ unsigned int width;
int masklen = atoi(in+1);
if (masklen < 0 || masklen > 32)
return -EINVAL;
if (masklen == 0)
return 0;
+ width = osmo_ss7_pc_width(inst ? &inst->cfg.pc_fmt :
&default_pc_fmt);
return (0xFFFFFFFF << (width - masklen)) & ((1 << width)-1);
}
/* parse mask as point code */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/43384?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Ie0728cef36c1cbeb755baef105f3ab88d025db01
Gerrit-Change-Number: 43384
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>