|
1 Index: main.c |
|
2 diff -Nau main.c.orig main.c |
|
3 --- main.c.orig 2009-12-10 14:11:03.590141302 +0100 |
|
4 +++ main.c 2009-12-10 14:11:07.246237908 +0100 |
|
5 @@ -1038,6 +1038,10 @@ |
|
6 ret=-1; |
|
7 my_argc=argc; my_argv=argv; |
|
8 |
|
9 + /* if (!log_stderr), that's not usable yet! '/ |
|
10 + /* ...so unconditionally log to syslog for now */ |
|
11 + openlog(argv[0], LOG_PID|LOG_CONS, log_facility); |
|
12 + |
|
13 /*init pkg mallocs (before parsing cfg or cmd line !)*/ |
|
14 if (init_pkg_mallocs()==-1) |
|
15 goto error00; |
|
16 @@ -1370,6 +1374,11 @@ |
|
17 |
|
18 /* init_daemon? */ |
|
19 if (!dont_fork){ |
|
20 + /* shortly after main() we called openlog(3) to log */ |
|
21 + /* the initialization, but since daemonize() has its */ |
|
22 + /* own syslog(3) handling, we need to close the log first */ |
|
23 + closelog(); /* close the initialization logging logic */ |
|
24 + |
|
25 if ( daemonize((log_name==0)?argv[0]:log_name, &own_pgid) <0 ) |
|
26 goto error; |
|
27 } |
1 Index: Makefile.defs |
28 Index: Makefile.defs |
2 --- Makefile.defs.orig 2009-03-23 19:32:01 +0100 |
29 diff -Nau Makefile.defs.orig Makefile.defs |
3 +++ Makefile.defs 2009-03-24 19:10:36 +0100 |
30 --- Makefile.defs.orig 2007-12-13 14:39:06.000000000 +0100 |
4 @@ -1161,6 +1161,8 @@ |
31 +++ Makefile.defs 2008-01-14 16:48:02.811615000 +0100 |
|
32 @@ -220,7 +220,7 @@ |
|
33 else |
|
34 doc-dir = doc/$(MAIN_NAME)/ |
|
35 man-dir = man/ |
|
36 - data-dir = $(MAIN_NAME)/ |
|
37 + data-dir = share/$(MAIN_NAME)/ |
|
38 LOCALBASE ?= $(SYSBASE)/local |
|
39 endif |
|
40 endif |
|
41 @@ -1432,6 +1432,10 @@ |
|
42 LIBS+= -lsctp |
|
43 endif |
5 |
44 |
6 endif #mode=release |
45 +#conditionally add libfsl |
7 |
|
8 +LDFLAGS += -L$(prefix)/lib |
46 +LDFLAGS += -L$(prefix)/lib |
9 +LIBS += -lfsl |
47 +LIBS += -lfsl |
|
48 + |
|
49 ifneq ($(found_lock_method), yes) |
|
50 $(warning No locking method found so far, trying SYS V sems) |
|
51 DEFS+= -DUSE_SYSV_SEM # try sys v sems |
|
52 Index: scripts/opensipsctl.8 |
|
53 diff -Nau scripts/opensipsctl.8.orig scripts/opensipsctl.8 |
|
54 --- scripts/opensipsctl.8.orig 2009-03-25 00:22:16.771365571 +0100 |
|
55 +++ scripts/opensipsctl.8 2009-03-25 00:22:34.295365555 +0100 |
|
56 @@ -20,8 +20,6 @@ |
10 |
57 |
11 #*FLAGS used for compiling the modules |
58 .SH FILES |
12 ifeq ($(CC_NAME), gcc) |
59 .PD 0 |
13 @@ -1397,8 +1399,8 @@ |
60 -.I /etc/opensips/.opensipsctlrc |
|
61 -.br |
|
62 .I /usr/local/etc/opensips/.opensipsctlrc |
|
63 .br |
|
64 .I ~/.opensipsctlrc |
|
65 Index: scripts/osipsconsole |
|
66 diff -Nau scripts/osipsconsole.orig scripts/osipsconsole |
|
67 --- scripts/osipsconsole.orig 2009-12-08 03:31:32.633224883 +0100 |
|
68 +++ scripts/osipsconsole 2009-12-08 03:31:51.119960848 +0100 |
|
69 @@ -30,7 +30,6 @@ |
|
70 use Term::ReadLine; |
|
71 use DBI; |
|
72 use POSIX; |
|
73 -use Frontier::RPC2; |
|
74 use IO::Socket; |
|
75 use Socket; |
|
76 #use Net::IP; |
|
77 @@ -378,6 +377,12 @@ |
|
78 } |
|
79 } |
14 |
80 |
15 #add libssl if needed |
81 + if ( $MD5 eq "" ) { |
16 ifneq ($(TLS),) |
82 + if ( $arr[0] =~ /^\s*MD5/ ) { |
17 -DEFS+= -I$(LOCALBASE)/ssl/include -I$(LOCALBASE)/include -I$(SYSBASE)/include/openssl |
83 + $MD5 = $arr[1]; |
18 -LIBS+= -L$(LOCALBASE)/lib -L$(LOCALBASE)/ssl/lib -lssl -lcrypto |
84 + } |
19 +DEFS+= -I$(prefix)/include |
85 + } |
20 +LIBS+= -L$(prefix)/lib -lssl -lcrypto |
86 + |
21 endif |
87 if ( $AWK eq "" ) { |
22 |
88 if ( $arr[0] =~ /^\s*AWK/ ) { |
23 #add libsctp if needed |
89 $AWK = $arr[1]; |
24 Index: modules/permissions/parse_config.c |
90 Index: modules/permissions/parse_config.c |
25 --- modules/permissions/parse_config.c.orig 2009-03-23 19:31:32 +0100 |
91 diff -Nau modules/permissions/parse_config.c.orig modules/permissions/parse_config.c |
26 +++ modules/permissions/parse_config.c 2009-03-24 19:10:36 +0100 |
92 --- modules/permissions/parse_config.c.orig 2008-08-03 15:54:01 +0200 |
|
93 +++ modules/permissions/parse_config.c 2008-08-09 11:58:55 +0200 |
27 @@ -114,8 +114,11 @@ |
94 @@ -114,8 +114,11 @@ |
28 except = strstr(str, " EXCEPT "); |
95 except = strstr(str, " EXCEPT "); |
29 if (except) { |
96 if (except) { |
30 /* exception found */ |
97 /* exception found */ |
31 - strncpy(str2, str, except-str); |
98 - strncpy(str2, str, except-str); |
46 + strncpy(str2, str, sizeof(str2)-1); |
113 + strncpy(str2, str, sizeof(str2)-1); |
47 + str2[sizeof(str2)-1] = '\0'; |
114 + str2[sizeof(str2)-1] = '\0'; |
48 *e_exceptions = NULL; |
115 *e_exceptions = NULL; |
49 } |
116 } |
50 |
117 |
51 Index: rtpproxy-1.2.1/main.c |
118 Index: modules/nathelper/nathelper.c |
52 --- rtpproxy-1.2.1/main.c.orig 2009-03-24 05:46:13 +0100 |
119 diff -Nau modules/nathelper/nathelper.c.orig modules/nathelper/nathelper.c |
53 +++ rtpproxy-1.2.1/main.c 2009-03-24 19:10:36 +0100 |
120 --- modules/nathelper/nathelper.c.orig 2010-12-20 14:33:50.000000000 +0100 |
54 @@ -88,7 +88,11 @@ |
121 +++ modules/nathelper/nathelper.c 2011-01-26 17:48:40.685941382 +0100 |
55 bindhost = NULL; |
122 @@ -288,6 +288,9 @@ |
56 |
123 return 0; |
57 if ((n = resolve(ia, pf, bindhost, servname, AI_PASSIVE)) != 0) |
|
58 +#if defined(__sun__) |
|
59 + errx(1, "setbindhost"); |
|
60 +#else |
|
61 errx(1, "setbindhost: %s", gai_strerror(n)); |
|
62 +#endif |
|
63 } |
124 } |
64 |
125 |
65 static void |
126 +/* MSvB macros */ |
|
127 +#define OPENSIPS_NOOP ((void)0) |
|
128 + |
|
129 |
|
130 |
|
131 |
|
132 @@ -805,6 +808,7 @@ |
|
133 #define FIX_MEDIP 0x02 |
|
134 #define ADD_ANORTPPROXY 0x04 |
|
135 #define FIX_ORGIP 0x08 |
|
136 +#define FIX_RTCPIP 0x10 |
|
137 |
|
138 #define ADIRECTION "a=direction:active" |
|
139 #define ADIRECTION_LEN (sizeof(ADIRECTION) - 1) |
|
140 @@ -821,7 +825,9 @@ |
|
141 { |
|
142 char *buf; |
|
143 int offset; |
|
144 + int binlump; |
|
145 struct lump* anchor; |
|
146 + struct lump* templump; |
|
147 str omip, nip, oip; |
|
148 |
|
149 /* check that updating mediaip is really necessary */ |
|
150 @@ -852,7 +858,19 @@ |
|
151 memcpy(buf, CRLF, CRLF_LEN); |
|
152 memcpy(buf + CRLF_LEN, omip.s, omip.len); |
|
153 memcpy(buf + CRLF_LEN + omip.len, oldip->s, oldip->len); |
|
154 - if (insert_new_lump_after(anchor, buf, |
|
155 + |
|
156 + /* if the oldmediaip string is already */ |
|
157 + /* in the body then don't add it again */ |
|
158 + binlump = 0; |
|
159 + for (templump = msg->body_lumps; templump; templump = templump->next) |
|
160 + if (templump->op == LUMP_ADD && strstr(templump->u.value, buf)) |
|
161 + binlump = 1; |
|
162 + for (templump = msg->add_rm; templump; templump = templump->next) |
|
163 + if (templump->op == LUMP_ADD && strstr(templump->u.value, buf)) |
|
164 + binlump = 1; |
|
165 + if (strstr(body->s, buf) || binlump) |
|
166 + pkg_free(buf); |
|
167 + else if (insert_new_lump_after(anchor, buf, |
|
168 omip.len + oldip->len + CRLF_LEN, 0) == NULL) { |
|
169 LM_ERR("insert_new_lump_after failed\n"); |
|
170 pkg_free(buf); |
|
171 @@ -1038,6 +1056,12 @@ |
|
172 p= p->next; |
|
173 } |
|
174 |
|
175 + if (level & FIX_RTCPIP) { |
|
176 + /* Iterate all a=rtcp: and replace ips in them. */ |
|
177 + if (replace_sdp_ip(msg, &body, "a=rtcp:", str2?&ip:0)==-1) |
|
178 + return -1; |
|
179 + } |
|
180 + |
|
181 return 1; |
|
182 } |
|
183 |
|
184 Index: parser/sdp/sdp_helpr_funcs.c |
|
185 diff -Nau parser/sdp/sdp_helpr_funcs.c.orig parser/sdp/sdp_helpr_funcs.c |
|
186 --- parser/sdp/sdp_helpr_funcs.c.orig 2010-12-08 15:14:06.000000000 +0100 |
|
187 +++ parser/sdp/sdp_helpr_funcs.c 2011-01-27 00:39:50.128212053 +0100 |
|
188 @@ -392,7 +392,7 @@ |
|
189 |
|
190 cp1 = NULL; |
|
191 for (cp = body->s; (len = body->s + body->len - cp) > 0;) { |
|
192 - cp1 = (char*)ser_memmem(cp, line, len, 2); |
|
193 + cp1 = (char*)ser_memmem(cp, line, len, strlen(line)); |
|
194 if (cp1 == NULL || cp1[-1] == '\n' || cp1[-1] == '\r') |
|
195 break; |
|
196 cp = cp1 + 2; |