monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[monit-dev] [monit] r332 committed - bug #32583: Multiple SIP OPTIONS me


From: monit
Subject: [monit-dev] [monit] r332 committed - bug #32583: Multiple SIP OPTIONS messages use the same header data. T...
Date: Mon, 28 Feb 2011 16:01:32 +0000

Revision: 332
Author: address@hidden
Date: Mon Feb 28 08:00:47 2011
Log: bug #32583: Multiple SIP OPTIONS messages use the same header data. Thanks to Hugh Waite for patch.


http://code.google.com/p/monit/source/detail?r=332

Modified:
 /trunk/CHANGES.txt
 /trunk/configure.ac
 /trunk/monitor.c
 /trunk/protocols/radius.c
 /trunk/protocols/sip.c
 /trunk/sendmail.c
 /trunk/util.c

=======================================
--- /trunk/CHANGES.txt  Mon Feb 21 06:38:12 2011
+++ /trunk/CHANGES.txt  Mon Feb 28 08:00:47 2011
@@ -1,4 +1,4 @@
-                     CHANGES version 5.2.4
+                     CHANGES version 5.2.5

            This file summarizes changes made since 5.0

@@ -7,6 +7,13 @@
           https://savannah.nongnu.org/bugs/?group=monit


+Version 5.2.5
+
+* bug #32583: Multiple SIP OPTIONS messages use the same header data.
+  Thanks to Hugh Waite for patch.
+
+
+
 Version 5.2.4

 NEW FEATURES AND FUNCTIONS:
=======================================
--- /trunk/configure.ac Sat Dec 18 05:22:24 2010
+++ /trunk/configure.ac Mon Feb 28 08:00:47 2011
@@ -10,7 +10,7 @@
# Note: in case of beta subversion, use underscore "_" rather then dash "-"
 # since RPM doesn't allow dash in Version
 # Example: 5.0_beta2
-AC_INIT([monit], [5.2.4], address@hidden)
+AC_INIT([monit], [5.2.5], address@hidden)

 # Package info
 AC_REVISION([$Revision: 1.194 $])
=======================================
--- /trunk/monitor.c    Tue Feb 15 11:12:25 2011
+++ /trunk/monitor.c    Mon Feb 28 08:00:47 2011
@@ -227,6 +227,11 @@
    */
   signal(SIGPIPE, SIG_IGN);

+  /*
+   * Initialize the random number generator
+   */
+  srand(time(NULL) + getpid());
+
   /*
    * Initialize the Runtime mutex. This mutex
    * is used to synchronize handling of global
=======================================
--- /trunk/protocols/radius.c   Wed Jan 19 10:40:32 2011
+++ /trunk/protocols/radius.c   Mon Feb 28 08:00:47 2011
@@ -179,12 +179,9 @@
   secret = (P->request ? P->request : "testing123");
   secret_len = strlen(secret);

-  /* initialization of random param */
-  srand(time(NULL) + getpid());
-
   /* Get 16 bytes of (very bad) random data */
   for (i = 0; i < 16; i++)
-    request[i + 4] = ((unsigned int)rand()) & 0xff;
+    request[i + 4] = ((unsigned int)random()) & 0xff;

   /* sign the packet */
hmac_md5(request, sizeof(request), (unsigned char *)secret, secret_len, request + 22);
=======================================
--- /trunk/protocols/sip.c      Wed Jan 19 10:40:32 2011
+++ /trunk/protocols/sip.c      Mon Feb 28 08:00:47 2011
@@ -144,9 +144,6 @@

   myip= socket_get_local_host(s);

-  /* initialization of random param */
-  srand(time(NULL)+getpid()+seed);
-
   if(socket_print(s,
     "OPTIONS %s:%s SIP/2.0\r\n"
     "Via: SIP/2.0/%s %s:%d;branch=z9hG4bKh%u%s\r\n"
@@ -164,15 +161,15 @@
     transport,        // via transport udp|tcp
     myip,             // who its from
     port,             // our port
-    rand(),           // branch
+    random(),         // branch
     rport,            // rport option
     P->maxforward,    // maximum forwards
     proto,            // protocol
     request,          // to
     proto,            // protocol
     myip,             // from host
-    rand(),           // tag
-    rand(),           // call id
+    random(),         // tag
+    random(),         // call id
     proto,            // protocol
     myip,             // contact host
     port,             // contact port
=======================================
--- /trunk/sendmail.c   Fri Feb 18 08:59:50 2011
+++ /trunk/sendmail.c   Mon Feb 28 08:00:47 2011
@@ -174,7 +174,6 @@
   }

   for(i = 0, m= mail; m; m= m->next, i++) {
-    srandom(time(NULL) + getpid() + i);
     do_send(&S, "MAIL FROM: <%s>\r\n", m->from);
     do_status(&S);
     do_send(&S, "RCPT TO: <%s>\r\n", m->to);
=======================================
--- /trunk/util.c       Fri Feb 18 08:07:12 2011
+++ /trunk/util.c       Mon Feb 28 08:00:47 2011
@@ -1272,7 +1272,6 @@
       return NULL;
     }
     /* Generate the unique id */
-    srandom(time(NULL) + getpid());
snprintf(buf, STRLEN, "%lu%d%lu", (unsigned long)time(NULL), getpid(), random());
     md5_buffer(buf, strlen(buf), digest);
     Util_digest2Bytes(digest, 16, Run.id);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]