[Asterisk-code-review] res rtp asterisk: Manually ported blackice from 11.22 (asterisk[13])
Joshua Colp
asteriskteam at digium.com
Mon Oct 10 10:34:08 CDT 2016
Joshua Colp has posted comments on this change.
Change subject: res_rtp_asterisk: Manually ported blackice from 11.22
......................................................................
Patch Set 2: Code-Review-1
(3 comments)
https://gerrit.asterisk.org/#/c/4023/2//COMMIT_MSG
Commit Message:
Line 7: res_rtp_asterisk: Manually ported blackice from 11.22
I think this would be better as:
res_rtp_Asterisk: Add blackice option
The fact it is a backport from 11 doesn't really matter here.
https://gerrit.asterisk.org/#/c/4023/2/configs/samples/rtp.conf.sample
File configs/samples/rtp.conf.sample:
Line 66: ; necessary for ICE. Multiple subnets may be listed. If left unconfigured,
Extra whitespace in a few places here
https://gerrit.asterisk.org/#/c/4023/2/res/res_rtp_asterisk.c
File res/res_rtp_asterisk.c:
PS2, Line 2474: ast_sockaddr_parse(&saddr, pj_sockaddr_print(&address[pos], buf, sizeof(buf), 0), 0);
: /* Remove blacklisted addresses by testing against blackice subnet list */
: ast_rwlock_rdlock(&blackice_lock);
: if ((blackice == NULL) || (ast_apply_ha(blackice, &saddr) == AST_SENSE_ALLOW)) {
: ast_rwlock_unlock(&blackice_lock);
: if (basepos == -1) {
: basepos = pos;
: }
: pj_sockaddr_set_port(&address[pos], port);
: ast_rtp_ice_add_cand(rtp, component, transport, PJ_ICE_CAND_TYPE_HOST, 65535, &address[pos], &address[pos], NULL,
: pj_sockaddr_get_len(&address[pos]));
: } else {
: ast_rwlock_unlock(&blackice_lock);
: }
I think the comparison logic should be put into a separate function and used in both places.
--
To view, visit https://gerrit.asterisk.org/4023
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibee88f80d7693874fda1cceaef94a03bd86012c9
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Michael Walton <mike at farsouthnet.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-HasComments: Yes
More information about the asterisk-code-review
mailing list