[Asterisk-code-review] res/res pjsip session: Only check localnet if it is defined (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Thu Mar 16 14:42:56 CDT 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/5229 )

Change subject: res/res_pjsip_session: Only check localnet if it is defined
......................................................................


Patch Set 4:

(1 comment)

https://gerrit.asterisk.org/#/c/5229/4/res/res_pjsip_session.c
File res/res_pjsip_session.c:

PS4, Line 3115: transport_state->localnet && 
> I'm not following. Which then clause are you referring to?
if (!transport_state->localnet || (transport_state->localnet && ast_apply_ha(transport_state->localnet, &addr) != AST_SENSE_ALLOW)) {
  This 'then' code location.
}

The transport_state->localnet is tested twice when it doesn't need to be.  Code is equivalent to:

if (!transport_state->localnet || ast_apply_ha(transport_state->localnet, &addr) != AST_SENSE_ALLOW) {
}


-- 
To view, visit https://gerrit.asterisk.org/5229
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib661c31a954cabc9c99f1f25c9c9a5c5b82cbbfb
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list