[svn-commits] coreyfarrell: branch 1.8 r406933 - in /branches/1.8: main/ res/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jan 30 14:26:56 CST 2014


Author: coreyfarrell
Date: Thu Jan 30 14:26:52 2014
New Revision: 406933

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=406933
Log:
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

Modified:
    branches/1.8/main/udptl.c
    branches/1.8/res/res_rtp_asterisk.c

Modified: branches/1.8/main/udptl.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/udptl.c?view=diff&rev=406933&r1=406932&r2=406933
==============================================================================
--- branches/1.8/main/udptl.c (original)
+++ branches/1.8/main/udptl.c Thu Jan 30 14:26:52 2014
@@ -968,7 +968,7 @@
 		if (ast_bind(udptl->fd, &udptl->us) == 0) {
 			break;
 		}
-		if (errno != EADDRINUSE) {
+		if (errno != EADDRINUSE && errno != EACCES) {
 			ast_log(LOG_WARNING, "Unexpected bind error: %s\n", strerror(errno));
 			close(udptl->fd);
 			ast_free(udptl);

Modified: branches/1.8/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_rtp_asterisk.c?view=diff&rev=406933&r1=406932&r2=406933
==============================================================================
--- branches/1.8/res/res_rtp_asterisk.c (original)
+++ branches/1.8/res/res_rtp_asterisk.c Thu Jan 30 14:26:52 2014
@@ -596,7 +596,7 @@
 		}
 
 		/* 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);




More information about the svn-commits mailing list