mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
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
This commit is contained in:
@@ -1051,7 +1051,7 @@ struct ast_udptl *ast_udptl_new_with_bindaddr(struct ast_sched_context *sched, s
|
||||
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);
|
||||
|
Reference in New Issue
Block a user