]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
reduce the likelihood that HTTP Manager session ids will consist of primarily '1...
authorKevin P. Fleming <kpfleming@digium.com>
Thu, 21 Feb 2008 14:33:51 +0000 (14:33 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Thu, 21 Feb 2008 14:33:51 +0000 (14:33 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104015 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/manager.c

index 8e3309667546f3ecf01d339e165371de928c62d2..3edbc3e2248f579365292fb1ea937aefe33e053a 100644 (file)
@@ -2660,7 +2660,7 @@ static char *generic_http_callback(int format, struct sockaddr_in *requestor, co
                ast_mutex_init(&s->__lock);
                ast_mutex_lock(&s->__lock);
                s->inuse = 1;
-               s->managerid = rand() | (unsigned long)s;
+               s->managerid = rand() ^ (unsigned long) s;
                AST_LIST_LOCK(&sessions);
                AST_LIST_INSERT_HEAD(&sessions, s, list);
                /* Hook into the last spot in the event queue */