laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/21559 )
Change subject: gb_proxy: cosmetic: Use function rather than open-coding is_sgsn ...................................................................... gb_proxy: cosmetic: Use function rather than open-coding is_sgsn Change-Id: Id41d74ebd41e5084377a986f4a1acd53cae12bc1 --- M src/gbproxy/gb_proxy.c 1 file changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/59/21559/1 diff --git a/src/gbproxy/gb_proxy.c b/src/gbproxy/gb_proxy.c index 74f799d..98fa928 100644 --- a/src/gbproxy/gb_proxy.c +++ b/src/gbproxy/gb_proxy.c @@ -83,6 +83,12 @@ static int gbprox_relay2sgsn(struct gbproxy_config *cfg, struct msgb *old_msg, uint16_t ns_bvci, uint16_t sgsn_nsei); + +static int gbproxy_is_sgsn_nsei(struct gbproxy_config *cfg, uint16_t nsei) +{ + return nsei == cfg->nsip_sgsn_nsei; +} + static int check_bvc_nsei(struct gbproxy_bvc *bvc, uint16_t nsei) { OSMO_ASSERT(bvc); @@ -726,11 +732,6 @@ return bssgp_tx_status(BSSGP_CAUSE_INV_MAND_INF, NULL, orig_msg); } -static int gbproxy_is_sgsn_nsei(struct gbproxy_config *cfg, uint16_t nsei) -{ - return nsei == cfg->nsip_sgsn_nsei; -} - int gbprox_bssgp_send_cb(void *ctx, struct msgb *msg) { int rc; @@ -800,7 +801,7 @@ case NS_AFF_CAUSE_RECOVERY: LOGP(DPCU, LOGL_NOTICE, "NS-NSE %d became available\n", nsp->nsei); - if (nsp->nsei == cfg->nsip_sgsn_nsei) { + if (gbproxy_is_sgsn_nsei(cfg, nsp->nsei)) { /* look-up or create the BTS context for this BVC */ struct bssgp_bvc_ctx *bctx = btsctx_by_bvci_nsei(nsp->bvci, nsp->nsei); if (!bctx) @@ -810,7 +811,7 @@ } break; case NS_AFF_CAUSE_FAILURE: - if (nsp->nsei == cfg->nsip_sgsn_nsei) { + if (gbproxy_is_sgsn_nsei(cfg, nsp->nsei)) { /* sgsn */ /* TODO: BSVC: block all PtP towards bss */ rate_ctr_inc(&cfg->ctrg-> -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/21559 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Id41d74ebd41e5084377a986f4a1acd53cae12bc1 Gerrit-Change-Number: 21559 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <lafo...@osmocom.org> Gerrit-MessageType: newchange