From c35d07950f3753e018be76e88c70319a172bc89d Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Thu, 30 Jan 2014 20:36:21 +0000 Subject: res_rtp_asterisk & udptl: fix port selection to work with SELinux restrictions ast_bind to a port reserved for another program by SELinux causes errno == EACCES. This caused random failures when binding rtp or udptl sockets. Treat EACCES as a non-fatal error, try next port. (closes issue ASTERISK-23134) Reported by: Corey Farrell ........ Merged revisions 406933 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406934 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 406935 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406936 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_rtp_asterisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'res') diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index b2f11dc37..1e9f0705d 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -1822,7 +1822,7 @@ static int ast_rtp_new(struct ast_rtp_instance *instance, } /* See if we ran out of ports or if the bind actually failed because of something other than the address being in use */ - if (x == startplace || errno != EADDRINUSE) { + if (x == startplace || (errno != EADDRINUSE && errno != EACCES)) { ast_log(LOG_ERROR, "Oh dear... we couldn't allocate a port for RTP instance '%p'\n", instance); close(rtp->s); ast_free(rtp); -- cgit v1.2.3