Module: sip-router
Branch: sr_3.0
Commit: 289c0f89329742fd488da6c4defae58bb3b6dc50
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=289c0f8…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed Aug 18 18:39:43 2010 +0200
tm: don't reply if the reply dest. is not yet set
- relay_reply() doesn't attempt to send the reply if the reply
destination is not yet fully set. This can happen for example
if reply_to_via is set, Via contains a host name (and not an ip)
and before having a chance to resolve the name a reply must be
sent (reply for a message that hasn't been sent yet: very
unlikely, but possible).
- use a membar_write() in init_rb(), before setting the reply send
socket (the reply send socket is also used as a flag for a fully
initialized reply destination and the membar_write() makes sure
that everything else was written before the send socket and no
re-ordering will take place).
(cherry picked from commit 96e1bc629bc7ed78dd64b221bc54b266cd45e3ca)
---
modules/tm/t_lookup.c | 17 ++---------------
modules/tm/t_reply.c | 8 +++++---
2 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/modules/tm/t_lookup.c b/modules/tm/t_lookup.c
index 25f9fc4..c706d91 100644
--- a/modules/tm/t_lookup.c
+++ b/modules/tm/t_lookup.c
@@ -1196,7 +1196,6 @@ int init_rb( struct retr_buf *rb, struct sip_msg *msg)
/*struct socket_info* send_sock;*/
struct via_body* via;
int proto;
- int backup_mhomed;
/* rb. timers are init. init_t()/new_cell() */
via=msg->via1;
@@ -1220,20 +1219,8 @@ int init_rb( struct retr_buf *rb, struct sip_msg *msg)
rb->dst.comp=via->comp_no;
#endif
rb->dst.send_flags=msg->rpl_send_flags;
- /* turn off mhomed for generating replies -- they are ideally sent to where
- request came from to make life with NATs and other beasts easier
- */
- backup_mhomed=mhomed;
- mhomed=0;
- mhomed=backup_mhomed;
- /* use for sending replies the incoming interface of the request -bogdan */
- /*send_sock=get_send_socket(msg, &rb->dst.to, proto);
- if (send_sock==0) {
- LOG(L_ERR, "ERROR: init_rb: cannot fwd to af %d, proto %d "
- "no socket\n", rb->dst.to.s.sa_family, proto);
- ser_error=E_BAD_VIA;
- return 0;
- }*/
+
+ membar_write();
rb->dst.send_sock=msg->rcv.bind_address;
return 1;
}
diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 7c941ea..e2b3b2c 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -598,7 +598,7 @@ static int _reply_light( struct cell *trans, char* buf, unsigned int len,
If reply_to_via is set and via contains a host name (and not an ip)
the chances for this increase a lot.
*/
- if (!trans->uas.response.dst.send_sock) {
+ if (unlikely(!trans->uas.response.dst.send_sock)) {
LOG(L_ERR, "ERROR: _reply_light: no resolved dst to send reply to\n");
} else {
if (likely(SEND_PR_BUFFER( rb, buf, len )>=0)){
@@ -1706,7 +1706,8 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
if (reply_status == RPS_COMPLETED) {
start_final_repl_retr(t);
}
- if (SEND_PR_BUFFER( uas_rb, buf, res_len )>=0){
+ if (likely(uas_rb->dst.send_sock &&
+ SEND_PR_BUFFER( uas_rb, buf, res_len ) >= 0)){
if (unlikely(!totag_retr && has_tran_tmcbs(t, TMCB_RESPONSE_OUT))){
run_trans_callbacks( TMCB_RESPONSE_OUT, t, t->uas.request,
relayed_msg, relayed_code);
@@ -1721,7 +1722,8 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
run_onsend_callbacks2(TMCB_RESPONSE_SENT, t, &onsend_params);
}
#endif
- }
+ } else if (unlikely(uas_rb->dst.send_sock == 0))
+ ERR("no resolved dst to send reply to\n");
/* Call put_on_wait() only if we really send out
* the reply. It can happen that the reply has been already sent from
* failure_route or from a callback and the timer has been already
Module: sip-router
Branch: sr_3.0
Commit: e71147a275a03dbad1e130fb78d964e1e8e4f938
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e71147a…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed Aug 11 19:31:14 2010 +0200
presence_dialoginfo(k): fix bsd compilation
On FreeBSD don't define _XOPEN_SOURCE (define it only on linux).
It's not needed for strptime() and worse will cause some other
defines to be missing, like INADDR_LOOPBACK ( if_XOPEN_SOURCE
is defined, __BSD_VISIBLE will be undefined => lots of missing
defines).
Reported-by: Reported-by: Olle E. Johansson oej edvina net
(cherry picked from commit 850a7b31de86056fc9223d809dfae54b0e490c5f)
---
modules_k/presence_dialoginfo/pidf.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules_k/presence_dialoginfo/pidf.c b/modules_k/presence_dialoginfo/pidf.c
index 9285d2b..d90de4c 100644
--- a/modules_k/presence_dialoginfo/pidf.c
+++ b/modules_k/presence_dialoginfo/pidf.c
@@ -36,12 +36,12 @@
* use 600 for 'Single UNIX Specification, Version 3'
* _XOPEN_SOURCE creates conflict in header definitions in Solaris
*/
-#ifndef __OS_solaris
- #define _XOPEN_SOURCE 600 /* glibc2 on linux, bsd */
+#ifdef __OS_linux
+ #define _XOPEN_SOURCE 600 /* glibc2 on linux */
#define _BSD_SOURCE 1 /* needed on linux to "fix" the effect
of the above define on
features.h/unistd.h syscall() */
-#else
+#elif defined __OS_solaris
#define _XOPEN_SOURCE_EXTENDED 1 /* solaris */
#endif
Module: sip-router
Branch: sr_3.0
Commit: f78a76244e9261ea6081dabeecfaf93dcc303307
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f78a762…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Fri Aug 13 11:45:39 2010 +0200
core: DragonFly kqueue support enabled
- fixed kqueue support check for DragonFly (seems to be always
supported since it was forked from FreeBSD 4.8).
- in dragonfly case define both __OS_freebsd and __OS_dragonfly so
that we can make some exceptions for dragonfly (e.g. no >= 4.1
version check at runtime before enabling kqueue).
- assume SCTP in 2.6 is at least on par with SCTP in FreeBSD 7.1.
(cherry picked from commit c07c2b5e599a2b97fc21d04731f1f9d409859d43)
---
Makefile.defs | 27 +++++++++++++++------------
io_wait.c | 10 ++++++++--
2 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/Makefile.defs b/Makefile.defs
index decc247..c3614fc 100644
--- a/Makefile.defs
+++ b/Makefile.defs
@@ -618,18 +618,20 @@ $(info target architecture <$(ARCH)>, host architecture <$(HOST_ARCH)>)
# adds support for Application Server interface
# Sometimes is needes correct non-quoted $OS. HACK: gcc translates known OS to number ('linux'), so there is added underscore
-# Tell it that dragonflybsd is equivalent to compiling for freebsd.
-# This will cause __OS_freebsd to be defined below.
ifeq ($(OS), dragonfly)
- EQUIV_OS := freebsd
+ # Tell it that dragonflybsd is equivalent to compiling for freebsd, but
+ # define also __OS_dragonfly (for fine-tunning like kqueue support).
+ os_defs := -D__OS_freebsd -D__OS_dragonfly
+ EQUIV_OS = freebsd
else
- EQUIV_OS := $(OS)
+ os_defs := -D__OS_$(OS)
+ EQUIV_OS = $(OS)
endif
C_DEFS= $(extra_defs) \
-DNAME='"$(MAIN_NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
-DOS='$(OS)_' -DOS_QUOTED='"$(OS)"' -DCOMPILER='"$(CC_VER)"'\
- -D__CPU_$(ARCH) -D__OS_$(EQUIV_OS) \
+ -D__CPU_$(ARCH) $(os_defs) \
-DSER_VER=$(SER_VER) \
-DCFG_DIR='"$(cfg_target)"'\
-DPKG_MALLOC \
@@ -1806,11 +1808,9 @@ ifeq ($(OS), dragonfly)
else
LIBS= #dlopen is in libc
endif
- # check for ver >= 4.1
- ifeq ($(shell [ $(OSREL_N) -gt 4001 ] && echo has_kqueue), has_kqueue)
- ifeq ($(NO_KQUEUE),)
- C_DEFS+=-DHAVE_KQUEUE
- endif
+ # dragonfly was forked from freebsd 4.8 => all version have kqueue
+ ifeq ($(NO_KQUEUE),)
+ C_DEFS+=-DHAVE_KQUEUE
endif
ifeq ($(NO_SELECT),)
C_DEFS+=-DHAVE_SELECT
@@ -1826,8 +1826,11 @@ ifeq ($(OS), dragonfly)
$(info "sctp development files not installed -- sctp disabled")
override SCTP :=
endif
- ifeq ($(shell [ $(OSREL_N) -lt 7000 ] && echo sctp), sctp)
-$(info "old freebsd version (>= 7.0 needed) -- sctp disabled")
+ # FIXME: don't know what's the status of SCTP on dragonfly
+ # (we suppose the 2.6 version is >= the version in
+ # in freebsd 7.0)
+ ifeq ($(shell [ $(OSREL_N) -lt 2006 ] && echo sctp), sctp)
+$(info "old dragonfly version (>= 2.6 needed) -- sctp disabled")
override SCTP :=
endif
diff --git a/io_wait.c b/io_wait.c
index 1b29813..72e34ee 100644
--- a/io_wait.c
+++ b/io_wait.c
@@ -333,10 +333,13 @@ char* check_poll_method(enum poll_types poll_method)
#ifndef HAVE_KQUEUE
ret="kqueue not supported, try re-compiling with -DHAVE_KQUEUE";
#else
- /* only in FreeBSD 4.1, NETBSD 2.0, OpenBSD 2.9, Darwin */
+ /* only in FreeBSD 4.1, NETBSD 2.0, OpenBSD 2.9, Darwin, DragonFly */
#ifdef __OS_freebsd
+ /* all DragonFly versions have kqueque */
+ #ifndef __OS_dragonfly
if (_os_ver<0x0401) /* if ver < 4.1 */
ret="kqueue not supported on FreeBSD < 4.1";
+ #endif /* __OS_dragonfly */
#elif defined (__OS_netbsd)
if (_os_ver<0x020000) /* if ver < 2.0 */
ret="kqueue not supported on NetBSD < 2.0";
@@ -381,9 +384,12 @@ enum poll_types choose_poll_method()
#endif
#ifdef HAVE_KQUEUE
if (poll_method==0)
- /* only in FreeBSD 4.1, NETBSD 2.0, OpenBSD 2.9, Darwin */
+ /* only in FreeBSD 4.1, NETBSD 2.0, OpenBSD 2.9, Darwin, DragonFly */
#ifdef __OS_freebsd
+ /* all DragonFly versions have kqueque */
+ #ifndef __OS_dragonfly
if (_os_ver>=0x0401) /* if ver >= 4.1 */
+ #endif /**__OS_dragonfly
#elif defined (__OS_netbsd)
if (_os_ver>=0x020000) /* if ver >= 2.0 */
#elif defined (__OS_openbsd)
Module: sip-router
Branch: sr_3.0
Commit: d1c12a8b1facd9bfd65550264de796caad6116d1
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d1c12a8…
Author: Vincent Stemen <vince.lists(a)ngtek.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed Aug 11 16:45:05 2010 +0200
db_text(k) makefile: fix make use
This fixes a bug. It called make directly which breaks on
platforms where it is being compiled under gmake.
Signed-off-by: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
(cherry picked from commit 5d8552087be74332c1a7812ffb01d8298060cc62)
---
modules_k/db_text/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/modules_k/db_text/Makefile b/modules_k/db_text/Makefile
index dd35b11..36bc48b 100644
--- a/modules_k/db_text/Makefile
+++ b/modules_k/db_text/Makefile
@@ -24,7 +24,7 @@ ifeq ($(INSTALL_FLAVOUR),kamailio)
# extra install for kamailio
install-dbtext-scripts: $(bin_prefix)/$(bin_dir)
- DBTEXTON=yes make -C ../../utils/kamctl/ install-modules
+ DBTEXTON=yes $(MAKE) -C ../../utils/kamctl/ install-modules
install-scripts: install-dbtext-scripts
Module: sip-router
Branch: sr_3.0
Commit: 1cfb5b678ec102cfa586babaf29618de5debc3bf
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1cfb5b6…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed Aug 11 17:04:14 2010 +0200
NEWS: notes about Dragonfly BSD support
(cherry picked from commit f6b240d51684040572c75555b1f767df0100d970)
---
INSTALL | 20 +++++++++++---------
NEWS | 1 +
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/INSTALL b/INSTALL
index d1731e3..9a8c0cd 100644
--- a/INSTALL
+++ b/INSTALL
@@ -10,18 +10,18 @@ $Id$
===========================================
Welcome to the SIP router! This is an amazingly flexible, robust
- and secure SIP server built on years of experience in several Open
+ and secure SIP server built on years of experience in several Open
Source projects. It's a merge of the SIP Express Router and the
OpenSER/Kamailio products produced by a joint development team.
This memo gives you hints how to set up SIP Router quickly. To
understand how SIP Router works and how to configure it properly,
- please read the admin's guide available from the SIP Router website.
+ please read the admin's guide available from the SIP Router website.
- We also urge you to read latest ISSUES (available from SIP Router website
+ We also urge you to read latest ISSUES (available from SIP Router website
too) and check for potential problems in this release.
- Users of previous releases are encouraged to read NEWS to learn how to move to
- this new SIP Router version.
+ Users of previous releases are encouraged to read NEWS to learn how to move
+ to this new SIP Router version.
Table of Contents
@@ -41,11 +41,13 @@ Table of Contents
1. Supported Architectures and Requirements
-------------------------------------------
-Supported operating systems: Linux, FreeBSD, NetBSD, OpenBSD, Solaris, OS/X Darwin
-Partially supported: Windows+Cygwin (core + static modules only, no IPv6, no TCP,
-no dynamic modules)
+Supported operating systems: Linux, FreeBSD, NetBSD, OpenBSD, Solaris, OS/X
+Darwin, Dragonfly BSD.
+Partially supported: Windows+Cygwin (core + static modules only, no IPv6, no
+TCP, no dynamic modules)
-Supported architectures: i386, x86_64 (amd64), armv4l, sparc64, powerpc, powerpc64
+Supported architectures: i386, x86_64 (amd64), armv4l, sparc64, powerpc,
+powerpc64
Experimental architectures: mips1, mips2, sparc32, alpha
(for other architectures the Makefiles might need to be edited)
diff --git a/NEWS b/NEWS
index 225eedc..247456e 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ $Id$
sip-router changes
core:
+ - Dragonfly BSD support
- type casts operators: (int), (str).
- new operators eq, ne for string compares and ieq, ine for interger
compares. The names are not yet final (use them at your own risk).