summaryrefslogtreecommitdiff
path: root/net/ser/files
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2006-04-21 06:30:43 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2006-04-21 06:30:43 +0000
commitdfa121d9d966b38ff43f26fb1ce7a474f2e26cb5 (patch)
tree33a992c0c31ed5427e8c08d35b0c007099d52957 /net/ser/files
parentRequire perl from ports. (diff)
Merge in latest local changes and improvements:
o Allow radius and presence modules to be turned off; o don't override CFLAGS; o don't duplicate error messages to the console; o postgresql backend doesn't set NULL flag on results properly, so that don't use VAL_NULL() macros on them; o reconnect to MySQL db when necessary; o relax transaction matching rules, so that it works with wider range of phones; o add some missed sanity checks in usrloc; o ignore incoming UDP messages that are shorter than certain limin (128 bytes). They cannot be SIP messages anyway.
Notes
Notes: svn path=/head/; revision=160058
Diffstat (limited to 'net/ser/files')
-rw-r--r--net/ser/files/patch-Makefile10
-rw-r--r--net/ser/files/patch-Makefile.defs19
-rw-r--r--net/ser/files/patch-daemonize.c14
-rw-r--r--net/ser/files/patch-main.c10
-rw-r--r--net/ser/files/patch-modules::auth_db::authorize.c44
-rw-r--r--net/ser/files/patch-modules::mysql::my_con.c15
-rw-r--r--net/ser/files/patch-modules::tm::t_lookup.c19
-rw-r--r--net/ser/files/patch-modules::usrloc::urecord.c16
-rw-r--r--net/ser/files/patch-parser::msg_parser.h25
-rw-r--r--net/ser/files/patch-udp_server.c16
10 files changed, 174 insertions, 14 deletions
diff --git a/net/ser/files/patch-Makefile b/net/ser/files/patch-Makefile
index 99b6cc4ba0de..48110d77f7f0 100644
--- a/net/ser/files/patch-Makefile
+++ b/net/ser/files/patch-Makefile
@@ -3,7 +3,7 @@ $FreeBSD$
--- Makefile.orig
+++ Makefile
-@@ -45,13 +45,12 @@
+@@ -46,13 +46,12 @@
skip_modules?=
# if not set on the cmd. line or the env, exclude this modules:
@@ -17,11 +17,11 @@ $FreeBSD$
cpl-c \
- auth_radius group_radius uri_radius avp_radius \
- pa
-+ group_radius uri_radius avp_radius
++ $(RADIUS) $(PA)
# always exclude the CVS dir
override exclude_modules+= CVS $(skip_modules)
-@@ -263,7 +262,7 @@
+@@ -268,7 +267,7 @@
chmod 644 $(cfg-prefix)/$(cfg-dir)ser.cfg.sample
if [ -z "${skip_cfg_install}" -a \
! -f $(cfg-prefix)/$(cfg-dir)ser.cfg ]; then \
@@ -29,8 +29,8 @@ $FreeBSD$
+ cp $(cfg-prefix)/$(cfg-dir)ser.cfg.sample \
$(cfg-prefix)/$(cfg-dir)ser.cfg; \
fi
- # $(INSTALL-CFG) etc/ser.cfg $(cfg-prefix)/$(cfg-dir)
-@@ -272,10 +271,10 @@
+ # radius dictionary
+@@ -280,10 +279,10 @@
$(INSTALL-TOUCH) $(bin-prefix)/$(bin-dir)/ser
$(INSTALL-BIN) ser $(bin-prefix)/$(bin-dir)
$(INSTALL-TOUCH) $(bin-prefix)/$(bin-dir)/sc
diff --git a/net/ser/files/patch-Makefile.defs b/net/ser/files/patch-Makefile.defs
index 90c41afc2616..5a72b5cc5f15 100644
--- a/net/ser/files/patch-Makefile.defs
+++ b/net/ser/files/patch-Makefile.defs
@@ -1,5 +1,8 @@
---- Makefile.defs.orig Wed Jan 11 03:55:58 2006
-+++ Makefile.defs Thu Mar 2 19:08:17 2006
+
+$FreeBSD$
+
+--- Makefile.defs.orig
++++ Makefile.defs
@@ -169,10 +169,11 @@
INSTALL-TOUCH = touch # used to create the file first (good to
# make solaris install work)
@@ -32,7 +35,7 @@
ifeq ($(CC_NAME), gcc)
#common stuff
- CFLAGS=-g -O9 -funroll-loops -Wcast-align $(PROFILE) \
-+ CFLAGS=-funroll-loops -Wcast-align $(PROFILE) \
++ CFLAGS+=-funroll-loops -Wcast-align $(PROFILE) \
-Wall
#if gcc 4.0+
ifeq ($(CC_SHORTVER), 4.x)
@@ -132,7 +135,15 @@
LDFLAGS+=-g $(PROFILE)
MOD_LDFLAGS=-G $(LDFLAGS)
endif
-@@ -1034,7 +1034,7 @@
+@@ -1028,13 +1028,14 @@
+
+ ifeq ($(OS), freebsd)
+ DEFS+=-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN \
+- -DHAVE_SCHED_YIELD -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_CONNECT_ECONNRESET_BUG
++ -DHAVE_SCHED_YIELD -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_CONNECT_ECONNRESET_BUG \
++ -I$(LOCALBASE)/include
+ ifneq ($(found_lock_method), yes)
+ DEFS+= -DUSE_PTHREAD_MUTEX # try pthread sems
found_lock_method=yes
LIBS= -pthread -lfl #dlopen is in libc
else
diff --git a/net/ser/files/patch-daemonize.c b/net/ser/files/patch-daemonize.c
new file mode 100644
index 000000000000..88cd832a0ecc
--- /dev/null
+++ b/net/ser/files/patch-daemonize.c
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- daemonize.c
++++ daemonize.c
+@@ -198,7 +198,7 @@
+ }
+
+ if (log_stderr==0)
+- openlog(name, LOG_PID|LOG_CONS, log_facility);
++ openlog(name, LOG_PID, log_facility);
+ /* LOG_CONS, LOG_PERRROR ? */
+
+ return 0;
diff --git a/net/ser/files/patch-main.c b/net/ser/files/patch-main.c
index f490905b8b03..00ef167417fd 100644
--- a/net/ser/files/patch-main.c
+++ b/net/ser/files/patch-main.c
@@ -3,7 +3,7 @@ $FreeBSD$
--- main.c.orig
+++ main.c
-@@ -249,6 +251,10 @@
+@@ -251,6 +251,10 @@
be default yes, good for trouble-shooting
*/
int server_signature=1;
@@ -14,3 +14,11 @@ $FreeBSD$
/* should ser try to locate outbound interface on multihomed
* host? by default not -- too expensive
*/
+@@ -350,6 +354,7 @@
+ void cleanup(show_status)
+ {
+ /*clean-up*/
++ setlogmask(LOG_UPTO(LOG_INFO));
+ if (mem_lock)
+ shm_unlock(); /* hack: force-unlock the shared memory lock in case
+ some process crashed and let it locked; this will
diff --git a/net/ser/files/patch-modules::auth_db::authorize.c b/net/ser/files/patch-modules::auth_db::authorize.c
new file mode 100644
index 000000000000..15fb53b5e220
--- /dev/null
+++ b/net/ser/files/patch-modules::auth_db::authorize.c
@@ -0,0 +1,44 @@
+
+$FreeBSD$
+
+--- modules/auth_db/authorize.c
++++ modules/auth_db/authorize.c
+@@ -101,7 +101,7 @@
+ }
+ pkg_free(col);
+
+- if ((RES_ROW_N(*res) == 0) || VAL_NULL(ROW_VALUES(RES_ROWS(*res)))) {
++ if (RES_ROW_N(*res) == 0) {
+ DBG("get_ha1(): no result for user \'%.*s@%.*s\'\n",
+ _username->user.len, ZSW(_username->user.s), (use_domain ? (_domain->len) : 0), ZSW(_domain->s));
+ return 1;
+@@ -212,9 +212,7 @@
+ rpid.s = NULL;
+ rpid.len = 0;
+ for (i = 0; i < avps_str_n; i++) {
+- if (avps_str[i].len != 4
+- || VAL_NULL(&(result->rows[0].values[1 + avps_int_n + i]))
+- || memcmp(avps_str[i].s, "rpid", 4) != 0)
++ if (avps_str[i].len != 4 || memcmp(avps_str[i].s, "rpid", 4) != 0)
+ continue;
+ rpid.s = (char*)VAL_STRING(&(result->rows[0].values[1 + avps_int_n + i]));
+ if(rpid.s!=NULL)
+@@ -230,8 +228,6 @@
+ return -1;
+ case AUTHORIZED:
+ for (i = 0; i < avps_int_n; i++) {
+- if(VAL_NULL(&(result->rows[0].values[1 + i])))
+- continue;
+ iname.s = &(avps_int[i]);
+ ivalue.n = VAL_INT(&(result->rows[0].values[1 + i]));
+ add_avp(AVP_NAME_STR, iname, ivalue);
+@@ -240,8 +236,7 @@
+ }
+ for (i = 0; i < avps_str_n; i++) {
+ value.s = (char*)VAL_STRING(&(result->rows[0].values[1 + avps_int_n + i]));
+- if(VAL_NULL(&(result->rows[0].values[1 + avps_int_n + i]))
+- || value.s==NULL)
++ if(value.s==NULL)
+ continue;
+ iname.s = &(avps_str[i]);
+ value.len = strlen(value.s);
diff --git a/net/ser/files/patch-modules::mysql::my_con.c b/net/ser/files/patch-modules::mysql::my_con.c
new file mode 100644
index 000000000000..50c1d6070e42
--- /dev/null
+++ b/net/ser/files/patch-modules::mysql::my_con.c
@@ -0,0 +1,15 @@
+
+$FreeBSD$
+
+--- modules/mysql/my_con.c
++++ modules/mysql/my_con.c
+@@ -70,6 +70,9 @@
+ goto err;
+ }
+
++ /* Enable reconnection explictly */
++ ptr->con->reconnect = 1;
++
+ ptr->timestamp = time(0);
+
+ ptr->id = id;
diff --git a/net/ser/files/patch-modules::tm::t_lookup.c b/net/ser/files/patch-modules::tm::t_lookup.c
index e64315689ec4..18a3ddf1abf4 100644
--- a/net/ser/files/patch-modules::tm::t_lookup.c
+++ b/net/ser/files/patch-modules::tm::t_lookup.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- modules/tm/t_lookup.c.orig Fri Jul 16 00:18:34 2004
-+++ modules/tm/t_lookup.c Tue Jul 27 21:01:37 2004
-@@ -97,8 +97,8 @@
+--- modules/tm/t_lookup.c.orig
++++ modules/tm/t_lookup.c
+@@ -103,8 +103,8 @@
#include "t_msgbuilder.h" /* for t_lookup_callid */
#define EQ_VIA_LEN(_via)\
@@ -14,7 +14,7 @@ $FreeBSD$
-@@ -116,7 +116,7 @@
+@@ -122,7 +122,7 @@
#define EQ_VIA_STR(_via)\
( memcmp( t_msg->_via->name.s,\
p_msg->_via->name.s,\
@@ -23,3 +23,14 @@ $FreeBSD$
)==0 )
+@@ -264,8 +264,10 @@
+ if (memcmp(inv_via->host.s, ack_via->host.s,
+ ack_via->host.len)!=0)
+ return 0;
++#if 0
+ if (inv_via->port!=ack_via->port)
+ return 0;
++#endif
+ if (inv_via->transport.len!=ack_via->transport.len)
+ return 0;
+ if (memcmp(inv_via->transport.s, ack_via->transport.s,
diff --git a/net/ser/files/patch-modules::usrloc::urecord.c b/net/ser/files/patch-modules::usrloc::urecord.c
new file mode 100644
index 000000000000..33be6b49cd95
--- /dev/null
+++ b/net/ser/files/patch-modules::usrloc::urecord.c
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- modules/usrloc/urecord.c
++++ modules/usrloc/urecord.c
+@@ -502,8 +502,8 @@
+
+ ptr = _r->contacts;
+ while(ptr) {
+- if ((_c->len == ptr->c.len) &&
+- !memcmp(_c->s, ptr->c.s, _c->len)) {
++ if (_c == NULL || ((_c->len == ptr->c.len) &&
++ !memcmp(_c->s, ptr->c.s, _c->len))) {
+ *_co = ptr;
+ return 0;
+ }
diff --git a/net/ser/files/patch-parser::msg_parser.h b/net/ser/files/patch-parser::msg_parser.h
new file mode 100644
index 000000000000..aae77f66f6cb
--- /dev/null
+++ b/net/ser/files/patch-parser::msg_parser.h
@@ -0,0 +1,25 @@
+
+$FreeBSD$
+
+--- parser/msg_parser.h.orig
++++ parser/msg_parser.h
+@@ -193,6 +193,7 @@
+ struct hdr_field* accept_disposition;
+ struct hdr_field* diversion;
+ struct hdr_field* rpid;
++ struct hdr_field* server;
+
+ char* eoh; /* pointer to the end of header (if found) or null */
+ char* unparsed; /* here we stopped parsing*/
+@@ -287,7 +288,11 @@
+
+ /* topmost Via is part of transaction key as well ! */
+ src[5]= msg->via1->host;
++#if 0
+ src[6]= msg->via1->port_str;
++#else
++ src[6].len = 0;
++#endif
+ if (msg->via1->branch) {
+ src[7]= msg->via1->branch->value;
+ MDStringArray ( cv, src, 8 );
diff --git a/net/ser/files/patch-udp_server.c b/net/ser/files/patch-udp_server.c
new file mode 100644
index 000000000000..89b155fd5583
--- /dev/null
+++ b/net/ser/files/patch-udp_server.c
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- udp_server.c
++++ udp_server.c
+@@ -432,6 +432,10 @@
+ continue; /* goto skip;*/
+ else goto error;
+ }
++ if (len < 128) {
++ /* Message is too short, just drop it already */
++ continue;
++ }
+ /* we must 0-term the messages, receive_msg expects it */
+ buf[len]=0; /* no need to save the previous char */
+