aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-26 18:38:07 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-26 18:38:07 +0000
commit2bc10bdba92df642603f13eaa139decd4a6122a1 (patch)
tree1fd38131778d8626b09cd9ac8124fb24de8ad8fb
parent485912cfe4d12423c997b8ee2537b8b24f721d3b (diff)
Merged revisions 159475 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r159475 | tilghman | 2008-11-26 12:33:04 -0600 (Wed, 26 Nov 2008) | 7 lines If the config file does not exist, then the first use crashes Asterisk. (closes issue #13848) Reported by: klaus3000 Patches: udptl.c.patch uploaded by eliel (license 64) Tested by: blitzrage ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@159477 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/udptl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/udptl.c b/main/udptl.c
index 6b14ec56f..3b747ec6b 100644
--- a/main/udptl.c
+++ b/main/udptl.c
@@ -74,8 +74,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define TRUE (!FALSE)
#endif
-static int udptlstart;
-static int udptlend;
+static int udptlstart = 4500;
+static int udptlend = 4599;
static int udptldebug; /*!< Are we debugging? */
static struct sockaddr_in udptldebugaddr; /*!< Debug packets to/from this host */
#ifdef SO_NO_CHECK
@@ -808,7 +808,7 @@ struct ast_udptl *ast_udptl_new_with_bindaddr(struct sched_context *sched, struc
setsockopt(udptl->fd, SOL_SOCKET, SO_NO_CHECK, &nochecksums, sizeof(nochecksums));
#endif
/* Find us a place */
- x = (ast_random() % (udptlend - udptlstart)) + udptlstart;
+ x = (udptlstart == udptlend) ? udptlstart : (ast_random() % (udptlend - udptlstart)) + udptlstart;
startplace = x;
for (;;) {
udptl->us.sin_port = htons(x);