]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
(closes issue #10125)
authorRussell Bryant <russell@russellbryant.com>
Fri, 6 Jul 2007 15:55:41 +0000 (15:55 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 6 Jul 2007 15:55:41 +0000 (15:55 +0000)
Reported by: makoto
Patches submitted by: makoto

This fixes a crash in chan_sip that happens when the bindaddr setting is not
valid on Asterisk startup, gets fixed, and then a reload gets issued.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@73678 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index e8ca9dd0c1cf5c3a138d3e1b2165fe941ecbe700..e01fbf9e37d647da0e19b06f25025bd291acb583 100644 (file)
@@ -11672,8 +11672,12 @@ static void *do_monitor(void *data)
                        sip_do_reload();
 
                        /* Change the I/O fd of our UDP socket */
-                       if (sipsock > -1)
-                               sipsock_read_id = ast_io_change(io, sipsock_read_id, sipsock, NULL, 0, NULL);
+                       if (sipsock > -1) {
+                               if (sipsock_read_id)
+                                       sipsock_read_id = ast_io_change(io, sipsock_read_id, sipsock, NULL, 0, NULL);
+                               else
+                                       sipsock_read_id = ast_io_add(io, sipsock, sipsock_read, AST_IO_IN, NULL);
+                       }
                }
                /* Check for interfaces needing to be killed */
                ast_mutex_lock(&iflock);