From 756c7cbb120c73de72f8e8dedcba1facea5029bd Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Wed, 5 Apr 2006 17:44:44 +0000 Subject: Bug 6873 - Finish moving from the non-threadsafe (and poor randomness) rand() to threadsafe ast_random() git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@17627 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- udptl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'udptl.c') diff --git a/udptl.c b/udptl.c index 0605892f7..25587d90d 100644 --- a/udptl.c +++ b/udptl.c @@ -794,7 +794,7 @@ struct ast_udptl *ast_udptl_new_with_bindaddr(struct sched_context *sched, struc udptl->tx[i].buf_len = -1; } - udptl->seqno = rand() & 0xffff; + udptl->seqno = ast_random() & 0xffff; udptl->them.sin_family = AF_INET; udptl->us.sin_family = AF_INET; @@ -810,7 +810,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 = (rand()%(udptlend - udptlstart)) + udptlstart; + x = (ast_random() % (udptlend - udptlstart)) + udptlstart; startplace = x; for (;;) { udptl->us.sin_port = htons(x); -- cgit v1.2.3