Hi,

Charles P Wright wrote:
> The rrs=true should be independent of next.  Did you try a SIPp -trace_msg 
> to see what it thinks it is sending?

Thanks for the hint. I already found a solution to my problem, SIPp was
working correctly.

Some further notes:

* The documentation of the [branch] keyword might be a little
misleading, since, for example, [branch-1] is not replaced by the value
of [branch] of the previous message (as one might think).

* The Redhat package of SIPp comes with some patches that might be worth
looking at. I have attached those patches.
** sipp--INT_MAX_headers_for_gcc43.diff for INT_MAX has been recently
merged as far as I have seen
** sipp--Makefile-fix-paths.diff: use the default system directories for
libraries and header files
** sipp--CVE-2008-2085-fix.diff: fix CVE-2008-2085
(http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-2085)

Bye,
Andreas
--- call.cpp.cve20082085	2008-07-06 12:38:01.000000000 +0400
+++ call.cpp	2008-07-06 17:11:11.000000000 +0400
@@ -125,17 +125,26 @@
     char pattern[] = "c=IN IP4 ";
     char *begin, *end;
     char ip[32];
-    begin = strstr(msg, pattern);
+    char *tmp = strdup(msg);
+
+    if(!tmp) return INADDR_NONE;
+    begin = strstr(tmp, pattern);
     if (!begin) {
+      free(tmp);
       /* Can't find what we're looking at -> return no address */
       return INADDR_NONE;
     }
     begin += sizeof("c=IN IP4 ") - 1;
     end = strstr(begin, "\r\n");
-    if (!end)
+    if (!end){
+      free(tmp);
       return INADDR_NONE;
+    }
+    *end = 0;
     memset(ip, 0, 32);
-    strncpy(ip, begin, end - begin);
+    strncpy(ip, begin, sizeof(ip) - 1);
+    ip[sizeof(ip) - 1] = 0;
+    free(tmp);
     return inet_addr(ip);
 }
 
@@ -148,20 +157,28 @@
     char pattern[] = "c=IN IP6 ";
     char *begin, *end;
     char ip[128];
+    char *tmp = strdup(msg);
 
     memset(&addr, 0, sizeof(addr));
     memset(ip, 0, 128);
 
-    begin = strstr(msg, pattern);
+    if(!tmp) return 0;
+    begin = strstr(tmp, pattern);
     if (!begin) {
+      free(tmp);
       /* Can't find what we're looking at -> return no address */
       return 0;
     }
     begin += sizeof("c=IN IP6 ") - 1;
     end = strstr(begin, "\r\n");
-    if (!end)
+    if (!end){
+      free(tmp);
       return 0;
-    strncpy(ip, begin, end - begin);
+    }
+    *end = 0;
+    strncpy(ip, begin, sizeof(ip) - 1);
+    ip[sizeof(ip) - 1] = 0;
+    free(tmp);
     if (!inet_pton(AF_INET6, ip, &addr)) {
       return 0;
     }
@@ -188,17 +205,25 @@
 	ERROR("Internal error: Undefined media pattern %d\n", 3);
     }
 
-    begin = strstr(msg, pattern);
+    char *tmp = strdup(msg);
+    if(!tmp) return 0;
+    begin = strstr(tmp, pattern);
     if (!begin) {
+      free(tmp);
       /* m=audio not found */
       return 0;
     }
     begin += strlen(pattern) - 1;
     end = strstr(begin, "\r\n");
-    if (!end)
+    if (!end){
+      free(tmp);
       ERROR("get_remote_port_media: no CRLF found");
+    }
+    *end = 0;
     memset(number, 0, sizeof(number));
     strncpy(number, begin, sizeof(number) - 1);
+    number[sizeof(number) - 1] = 0;
+    free(tmp);
     return atoi(number);
 }
 
--- call.cpp~	2007-11-06 13:18:07.000000000 +0300
+++ call.cpp	2008-02-21 13:22:54.000000000 +0300
@@ -41,6 +41,7 @@
 #include <iostream>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <limits.h>
 
 #ifdef PCAPPLAY
 #include "send_packets.h"
--- scenario.cpp~	2007-07-26 14:16:49.000000000 +0400
+++ scenario.cpp	2008-02-21 13:22:19.000000000 +0300
@@ -27,6 +27,7 @@
  */
 
 #include <stdlib.h>
+#include <limits.h>
 #include "sipp.hpp"
 #ifdef HAVE_GSL
 #include <gsl/gsl_rng.h>
--- Makefile	2007-11-05 13:26:04.000000000 +0300
+++ Makefile	2008-01-10 01:51:48.000000000 +0300
@@ -135,7 +135,7 @@
 LFLAGS=$(LFLAGS_$(SYSTEM)) $(EXTRALFLAGS)
 
 #Link Libraries
-LIBS_linux= -ldl -lpthread -lncurses -lstdc++ -lm -L /usr/local/lib -L /usr/lib -L /usr/lib64
+LIBS_linux= -ldl -lpthread -lncurses -lstdc++ -lm
 LIBS_hpux= -lcurses -lpthread -L /opt/openssl/lib -L /usr/local/lib
 LIBS_tru64= -lcurses -lpthread
 LIBS_freebsd= -lcurses -pthread -L /usr/local/lib
@@ -145,7 +145,7 @@
 LIBS=$(LIBS_$(SYSTEM)) $(EXTRALIBS)
 
 # Include directories
-INCDIR_linux=-I. -I/usr/include/openssl
+INCDIR_linux=-I.
 INCDIR_freebsd=-I. -I/usr/local/include
 INCDIR_hpux=-I. -I/usr/local/include -I/opt/openssl/include
 INCDIR_tru64=-I. -I/opt/openssl/include
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to