opensips/opensips.patch

changeset 410
b1bf69b8f573
parent 397
c98ae03f4266
child 416
0bc1d0d1fe3a
equal deleted inserted replaced
3:d02256c583fd 4:1827cf890bd0
1 Index: main.c 1 Index: main.c
2 diff -Nau main.c.orig main.c 2 diff -Nau main.c.orig main.c
3 --- main.c.orig 2009-12-10 14:11:03.590141302 +0100 3 --- main.c.orig 2012-03-21.orig 10:29:31.458420799 +0100
4 +++ main.c 2009-12-10 14:11:07.246237908 +0100 4 +++ main.c 2012-03-21 10:30:52.034994020 +0100
5 @@ -1038,6 +1038,10 @@ 5 @@ -1025,6 +1025,10 @@
6 ret=-1; 6 ret=-1;
7 my_argc=argc; my_argv=argv; 7 my_argc=argc; my_argv=argv;
8 8
9 + /* if (!log_stderr), that's not usable yet! '/ 9 + /* if (!log_stderr), that's not usable yet! '/
10 + /* ...so unconditionally log to syslog for now */ 10 + /* ...so unconditionally log to syslog for now */
11 + openlog(argv[0], LOG_PID|LOG_CONS, log_facility); 11 + openlog(argv[0], LOG_PID|LOG_CONS, log_facility);
12 + 12 +
13 /*init pkg mallocs (before parsing cfg or cmd line !)*/ 13 /*init pkg mallocs (before parsing cfg or cmd line !)*/
14 if (init_pkg_mallocs()==-1) 14 if (init_pkg_mallocs()==-1)
15 goto error00; 15 goto error00;
16 @@ -1370,6 +1374,11 @@ 16 @@ -1357,6 +1361,11 @@
17 17
18 /* init_daemon? */ 18 /* init_daemon? */
19 if (!dont_fork){ 19 if (!dont_fork){
20 + /* shortly after main() we called openlog(3) to log */ 20 + /* shortly after main() we called openlog(3) to log */
21 + /* the initialization, but since daemonize() has its */ 21 + /* the initialization, but since daemonize() has its */
25 if ( daemonize((log_name==0)?argv[0]:log_name, &own_pgid) <0 ) 25 if ( daemonize((log_name==0)?argv[0]:log_name, &own_pgid) <0 )
26 goto error; 26 goto error;
27 } 27 }
28 Index: Makefile.defs 28 Index: Makefile.defs
29 diff -Nau Makefile.defs.orig Makefile.defs 29 diff -Nau Makefile.defs.orig Makefile.defs
30 --- Makefile.defs.orig 2007-12-13 14:39:06.000000000 +0100 30 --- Makefile.defs.orig 2012-03-21.orig 10:29:31.252995930 +0100
31 +++ Makefile.defs 2008-01-14 16:48:02.811615000 +0100 31 +++ Makefile.defs 2012-03-21 10:30:52.038327356 +0100
32 @@ -220,7 +220,7 @@ 32 @@ -220,7 +220,7 @@
33 else 33 else
34 doc-dir = doc/$(MAIN_NAME)/ 34 doc-dir = doc/$(MAIN_NAME)/
35 man-dir = man/ 35 man-dir = man/
36 - data-dir = $(MAIN_NAME)/ 36 - data-dir = $(MAIN_NAME)/
49 ifneq ($(found_lock_method), yes) 49 ifneq ($(found_lock_method), yes)
50 $(warning No locking method found so far, trying SYS V sems) 50 $(warning No locking method found so far, trying SYS V sems)
51 DEFS+= -DUSE_SYSV_SEM # try sys v sems 51 DEFS+= -DUSE_SYSV_SEM # try sys v sems
52 Index: scripts/opensipsctl.8 52 Index: scripts/opensipsctl.8
53 diff -Nau scripts/opensipsctl.8.orig 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 54 --- scripts/opensipsctl.8.orig 2012-03-21.orig 10:29:31.357825870 +0100
55 +++ scripts/opensipsctl.8 2009-03-25 00:22:34.295365555 +0100 55 +++ scripts/opensipsctl.8 2012-03-21 10:30:52.039349015 +0100
56 @@ -20,8 +20,6 @@ 56 @@ -20,8 +20,6 @@
57 57
58 .SH FILES 58 .SH FILES
59 .PD 0 59 .PD 0
60 -.I /etc/opensips/.opensipsctlrc 60 -.I /etc/opensips/.opensipsctlrc
62 .I /usr/local/etc/opensips/.opensipsctlrc 62 .I /usr/local/etc/opensips/.opensipsctlrc
63 .br 63 .br
64 .I ~/.opensipsctlrc 64 .I ~/.opensipsctlrc
65 Index: scripts/osipsconsole 65 Index: scripts/osipsconsole
66 diff -Nau scripts/osipsconsole.orig scripts/osipsconsole 66 diff -Nau scripts/osipsconsole.orig scripts/osipsconsole
67 --- scripts/osipsconsole.orig 2009-12-08 03:31:32.633224883 +0100 67 --- scripts/osipsconsole.orig 2012-03-21.orig 10:29:31.335460757 +0100
68 +++ scripts/osipsconsole 2009-12-08 03:31:51.119960848 +0100 68 +++ scripts/osipsconsole 2012-03-21 10:30:52.050666821 +0100
69 @@ -30,7 +30,6 @@ 69 @@ -30,7 +30,6 @@
70 use Term::ReadLine; 70 use Term::ReadLine;
71 use DBI; 71 use DBI;
72 use POSIX; 72 use POSIX;
73 -use Frontier::RPC2; 73 -use Frontier::RPC2;
87 if ( $AWK eq "" ) { 87 if ( $AWK eq "" ) {
88 if ( $arr[0] =~ /^\s*AWK/ ) { 88 if ( $arr[0] =~ /^\s*AWK/ ) {
89 $AWK = $arr[1]; 89 $AWK = $arr[1];
90 Index: modules/permissions/parse_config.c 90 Index: modules/permissions/parse_config.c
91 diff -Nau modules/permissions/parse_config.c.orig modules/permissions/parse_config.c 91 diff -Nau modules/permissions/parse_config.c.orig modules/permissions/parse_config.c
92 --- modules/permissions/parse_config.c.orig 2008-08-03 15:54:01 +0200 92 --- modules/permissions/parse_config.c.orig 2012-03-21.orig 10:29:32.047580003 +0100
93 +++ modules/permissions/parse_config.c 2008-08-09 11:58:55 +0200 93 +++ modules/permissions/parse_config.c 2012-03-21 10:30:52.052696686 +0100
94 @@ -114,8 +114,11 @@ 94 @@ -114,8 +114,11 @@
95 except = strstr(str, " EXCEPT "); 95 except = strstr(str, " EXCEPT ");
96 if (except) { 96 if (except) {
97 /* exception found */ 97 /* exception found */
98 - strncpy(str2, str, except-str); 98 - strncpy(str2, str, except-str);
113 + strncpy(str2, str, sizeof(str2)-1); 113 + strncpy(str2, str, sizeof(str2)-1);
114 + str2[sizeof(str2)-1] = '\0'; 114 + str2[sizeof(str2)-1] = '\0';
115 *e_exceptions = NULL; 115 *e_exceptions = NULL;
116 } 116 }
117 117
118 Index: parser/sdp/sdp_helpr_funcs.c
119 diff -Nau parser/sdp/sdp_helpr_funcs.c.orig parser/sdp/sdp_helpr_funcs.c
120 --- parser/sdp/sdp_helpr_funcs.c.orig 2012-03-21.orig 10:29:31.444187545 +0100
121 +++ parser/sdp/sdp_helpr_funcs.c 2012-03-21 10:30:52.057616045 +0100
122 @@ -396,7 +396,7 @@
123
124 cp1 = NULL;
125 for (cp = body->s; (len = body->s + body->len - cp) > 0;) {
126 - cp1 = (char*)ser_memmem(cp, line, len, 2);
127 + cp1 = (char*)ser_memmem(cp, line, len, strlen(line));
128 if (cp1 == NULL || cp1[-1] == '\n' || cp1[-1] == '\r')
129 break;
130 cp = cp1 + 2;
118 Index: modules/nathelper/nathelper.c 131 Index: modules/nathelper/nathelper.c
119 diff -Nau modules/nathelper/nathelper.c.orig modules/nathelper/nathelper.c 132 diff -Nau modules/nathelper/nathelper.c.orig modules/nathelper/nathelper.c
120 --- modules/nathelper/nathelper.c.orig 2010-12-20 14:33:50.000000000 +0100 133 --- modules/nathelper/nathelper.c.orig 2012-03-21.orig 10:29:31.795178267 +0100
121 +++ modules/nathelper/nathelper.c 2011-01-26 17:48:40.685941382 +0100 134 +++ modules/nathelper/nathelper.c 2012-03-21 10:30:52.055610362 +0100
122 @@ -288,6 +288,9 @@ 135 @@ -289,6 +289,9 @@
123 return 0; 136 return 0;
124 } 137 }
125 138
126 +/* MSvB macros */ 139 +/* MSvB macros */
127 +#define OPENSIPS_NOOP ((void)0) 140 +#define OPENSIPS_NOOP ((void)0)
128 + 141 +
129 142
130 143
131 144
132 @@ -805,6 +808,7 @@ 145 @@ -813,6 +816,7 @@
133 #define FIX_MEDIP 0x02 146 #define FIX_MEDIP 0x02
134 #define ADD_ANORTPPROXY 0x04 147 #define ADD_ANORTPPROXY 0x04
135 #define FIX_ORGIP 0x08 148 #define FIX_ORGIP 0x08
136 +#define FIX_RTCPIP 0x10 149 +#define FIX_RTCPIP 0x10
137 150
138 #define ADIRECTION "a=direction:active" 151 #define ADIRECTION "a=direction:active"
139 #define ADIRECTION_LEN (sizeof(ADIRECTION) - 1) 152 #define ADIRECTION_LEN (sizeof(ADIRECTION) - 1)
140 @@ -821,7 +825,9 @@ 153 @@ -829,7 +833,9 @@
141 { 154 {
142 char *buf; 155 char *buf;
143 int offset; 156 int offset;
144 + int binlump; 157 + int binlump;
145 struct lump* anchor; 158 struct lump* anchor;
146 + struct lump* templump; 159 + struct lump* templump;
147 str omip, nip, oip; 160 str omip, nip, oip;
148 161
149 /* check that updating mediaip is really necessary */ 162 /* check that updating mediaip is really necessary */
150 @@ -852,7 +858,19 @@ 163 @@ -860,7 +866,19 @@
151 memcpy(buf, CRLF, CRLF_LEN); 164 memcpy(buf, CRLF, CRLF_LEN);
152 memcpy(buf + CRLF_LEN, omip.s, omip.len); 165 memcpy(buf + CRLF_LEN, omip.s, omip.len);
153 memcpy(buf + CRLF_LEN + omip.len, oldip->s, oldip->len); 166 memcpy(buf + CRLF_LEN + omip.len, oldip->s, oldip->len);
154 - if (insert_new_lump_after(anchor, buf, 167 - if (insert_new_lump_after(anchor, buf,
155 + 168 +
166 + pkg_free(buf); 179 + pkg_free(buf);
167 + else if (insert_new_lump_after(anchor, buf, 180 + else if (insert_new_lump_after(anchor, buf,
168 omip.len + oldip->len + CRLF_LEN, 0) == NULL) { 181 omip.len + oldip->len + CRLF_LEN, 0) == NULL) {
169 LM_ERR("insert_new_lump_after failed\n"); 182 LM_ERR("insert_new_lump_after failed\n");
170 pkg_free(buf); 183 pkg_free(buf);
171 @@ -1038,6 +1056,12 @@ 184 @@ -1046,6 +1064,12 @@
172 p= p->next; 185 p= p->next;
173 } 186 }
174 187
175 + if (level & FIX_RTCPIP) { 188 + if (level & FIX_RTCPIP) {
176 + /* Iterate all a=rtcp: and replace ips in them. */ 189 + /* Iterate all a=rtcp: and replace ips in them. */
179 + } 192 + }
180 + 193 +
181 return 1; 194 return 1;
182 } 195 }
183 196
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;

mercurial