michael@377: Index: main.c michael@377: diff -Nau main.c.orig main.c michael@377: --- main.c.orig 2009-12-10 14:11:03.590141302 +0100 michael@377: +++ main.c 2009-12-10 14:11:07.246237908 +0100 michael@397: @@ -1038,6 +1038,10 @@ michael@377: ret=-1; michael@377: my_argc=argc; my_argv=argv; michael@377: michael@377: + /* if (!log_stderr), that's not usable yet! '/ michael@377: + /* ...so unconditionally log to syslog for now */ michael@377: + openlog(argv[0], LOG_PID|LOG_CONS, log_facility); michael@377: + michael@377: /*init pkg mallocs (before parsing cfg or cmd line !)*/ michael@377: if (init_pkg_mallocs()==-1) michael@377: goto error00; michael@397: @@ -1370,6 +1374,11 @@ michael@377: michael@377: /* init_daemon? */ michael@377: if (!dont_fork){ michael@377: + /* shortly after main() we called openlog(3) to log */ michael@377: + /* the initialization, but since daemonize() has its */ michael@377: + /* own syslog(3) handling, we need to close the log first */ michael@377: + closelog(); /* close the initialization logging logic */ michael@377: + michael@377: if ( daemonize((log_name==0)?argv[0]:log_name, &own_pgid) <0 ) michael@377: goto error; michael@377: } michael@376: Index: Makefile.defs michael@377: diff -Nau Makefile.defs.orig Makefile.defs michael@377: --- Makefile.defs.orig 2007-12-13 14:39:06.000000000 +0100 michael@377: +++ Makefile.defs 2008-01-14 16:48:02.811615000 +0100 michael@397: @@ -220,7 +220,7 @@ michael@377: else michael@377: doc-dir = doc/$(MAIN_NAME)/ michael@377: man-dir = man/ michael@377: - data-dir = $(MAIN_NAME)/ michael@377: + data-dir = share/$(MAIN_NAME)/ michael@377: LOCALBASE ?= $(SYSBASE)/local michael@377: endif michael@377: endif michael@397: @@ -1432,6 +1432,10 @@ michael@377: LIBS+= -lsctp michael@377: endif michael@376: michael@377: +#conditionally add libfsl michael@376: +LDFLAGS += -L$(prefix)/lib michael@376: +LIBS += -lfsl michael@377: + michael@377: ifneq ($(found_lock_method), yes) michael@377: $(warning No locking method found so far, trying SYS V sems) michael@377: DEFS+= -DUSE_SYSV_SEM # try sys v sems michael@377: Index: scripts/opensipsctl.8 michael@377: diff -Nau scripts/opensipsctl.8.orig scripts/opensipsctl.8 michael@377: --- scripts/opensipsctl.8.orig 2009-03-25 00:22:16.771365571 +0100 michael@377: +++ scripts/opensipsctl.8 2009-03-25 00:22:34.295365555 +0100 michael@377: @@ -20,8 +20,6 @@ michael@376: michael@377: .SH FILES michael@377: .PD 0 michael@377: -.I /etc/opensips/.opensipsctlrc michael@377: -.br michael@377: .I /usr/local/etc/opensips/.opensipsctlrc michael@377: .br michael@377: .I ~/.opensipsctlrc michael@377: Index: scripts/osipsconsole michael@377: diff -Nau scripts/osipsconsole.orig scripts/osipsconsole michael@377: --- scripts/osipsconsole.orig 2009-12-08 03:31:32.633224883 +0100 michael@377: +++ scripts/osipsconsole 2009-12-08 03:31:51.119960848 +0100 michael@377: @@ -30,7 +30,6 @@ michael@377: use Term::ReadLine; michael@377: use DBI; michael@377: use POSIX; michael@377: -use Frontier::RPC2; michael@377: use IO::Socket; michael@377: use Socket; michael@377: #use Net::IP; michael@397: @@ -378,6 +377,12 @@ michael@377: } michael@377: } michael@376: michael@377: + if ( $MD5 eq "" ) { michael@377: + if ( $arr[0] =~ /^\s*MD5/ ) { michael@377: + $MD5 = $arr[1]; michael@377: + } michael@377: + } michael@377: + michael@377: if ( $AWK eq "" ) { michael@377: if ( $arr[0] =~ /^\s*AWK/ ) { michael@377: $AWK = $arr[1]; michael@376: Index: modules/permissions/parse_config.c michael@377: diff -Nau modules/permissions/parse_config.c.orig modules/permissions/parse_config.c michael@377: --- modules/permissions/parse_config.c.orig 2008-08-03 15:54:01 +0200 michael@377: +++ modules/permissions/parse_config.c 2008-08-09 11:58:55 +0200 michael@376: @@ -114,8 +114,11 @@ michael@376: except = strstr(str, " EXCEPT "); michael@376: if (except) { michael@376: /* exception found */ michael@376: - strncpy(str2, str, except-str); michael@376: - str2[except-str] = '\0'; michael@376: + int l = except - str; michael@376: + if (l > sizeof(str2) - 1) michael@376: + l = sizeof(str2) - 1; michael@376: + strncpy(str2, str, l); michael@376: + str2[l] = '\0'; michael@376: /* except+8 points to the exception */ michael@376: if (parse_expression_list(except+8, e_exceptions)) { michael@376: /* error */ michael@376: @@ -124,7 +127,8 @@ michael@376: } michael@376: } else { michael@376: /* no exception */ michael@376: - strcpy(str2, str); michael@376: + strncpy(str2, str, sizeof(str2)-1); michael@376: + str2[sizeof(str2)-1] = '\0'; michael@376: *e_exceptions = NULL; michael@376: } michael@376: michael@377: Index: modules/nathelper/nathelper.c michael@377: diff -Nau modules/nathelper/nathelper.c.orig modules/nathelper/nathelper.c michael@377: --- modules/nathelper/nathelper.c.orig 2010-12-20 14:33:50.000000000 +0100 michael@377: +++ modules/nathelper/nathelper.c 2011-01-26 17:48:40.685941382 +0100 michael@397: @@ -288,6 +288,9 @@ michael@397: return 0; michael@397: } michael@376: michael@377: +/* MSvB macros */ michael@377: +#define OPENSIPS_NOOP ((void)0) michael@377: + michael@377: michael@377: michael@397: michael@397: @@ -805,6 +808,7 @@ michael@377: #define FIX_MEDIP 0x02 michael@377: #define ADD_ANORTPPROXY 0x04 michael@377: #define FIX_ORGIP 0x08 michael@377: +#define FIX_RTCPIP 0x10 michael@377: michael@377: #define ADIRECTION "a=direction:active" michael@377: #define ADIRECTION_LEN (sizeof(ADIRECTION) - 1) michael@397: @@ -821,7 +825,9 @@ michael@377: { michael@377: char *buf; michael@377: int offset; michael@377: + int binlump; michael@377: struct lump* anchor; michael@377: + struct lump* templump; michael@377: str omip, nip, oip; michael@377: michael@377: /* check that updating mediaip is really necessary */ michael@397: @@ -852,7 +858,19 @@ michael@377: memcpy(buf, CRLF, CRLF_LEN); michael@377: memcpy(buf + CRLF_LEN, omip.s, omip.len); michael@377: memcpy(buf + CRLF_LEN + omip.len, oldip->s, oldip->len); michael@377: - if (insert_new_lump_after(anchor, buf, michael@377: + michael@397: + /* if the oldmediaip string is already */ michael@397: + /* in the body then don't add it again */ michael@377: + binlump = 0; michael@377: + for (templump = msg->body_lumps; templump; templump = templump->next) michael@377: + if (templump->op == LUMP_ADD && strstr(templump->u.value, buf)) michael@377: + binlump = 1; michael@377: + for (templump = msg->add_rm; templump; templump = templump->next) michael@377: + if (templump->op == LUMP_ADD && strstr(templump->u.value, buf)) michael@377: + binlump = 1; michael@377: + if (strstr(body->s, buf) || binlump) michael@377: + pkg_free(buf); michael@377: + else if (insert_new_lump_after(anchor, buf, michael@377: omip.len + oldip->len + CRLF_LEN, 0) == NULL) { michael@377: LM_ERR("insert_new_lump_after failed\n"); michael@377: pkg_free(buf); michael@397: @@ -1038,6 +1056,12 @@ michael@397: p= p->next; michael@397: } michael@397: michael@397: + if (level & FIX_RTCPIP) { michael@397: + /* Iterate all a=rtcp: and replace ips in them. */ michael@397: + if (replace_sdp_ip(msg, &body, "a=rtcp:", str2?&ip:0)==-1) michael@397: + return -1; michael@397: + } michael@397: + michael@397: return 1; michael@397: } michael@397: michael@377: Index: parser/sdp/sdp_helpr_funcs.c michael@377: diff -Nau parser/sdp/sdp_helpr_funcs.c.orig parser/sdp/sdp_helpr_funcs.c michael@377: --- parser/sdp/sdp_helpr_funcs.c.orig 2010-12-08 15:14:06.000000000 +0100 michael@377: +++ parser/sdp/sdp_helpr_funcs.c 2011-01-27 00:39:50.128212053 +0100 michael@377: @@ -392,7 +392,7 @@ michael@377: michael@377: cp1 = NULL; michael@377: for (cp = body->s; (len = body->s + body->len - cp) > 0;) { michael@377: - cp1 = (char*)ser_memmem(cp, line, len, 2); michael@377: + cp1 = (char*)ser_memmem(cp, line, len, strlen(line)); michael@377: if (cp1 == NULL || cp1[-1] == '\n' || cp1[-1] == '\r') michael@377: break; michael@377: cp = cp1 + 2;