[Pkg-voip-commits] [kamailio] 03/04: remove already applied upstream patches

Victor Seva vseva at moszumanska.debian.org
Mon Mar 7 22:44:21 UTC 2016


This is an automated email from the git hooks/post-receive script.

vseva pushed a commit to branch master
in repository kamailio.

commit c7f3947ea0afd231c873586bc87db3f5b33bd3eb
Author: Victor Seva <vseva at debian.org>
Date:   Sun Mar 6 19:54:31 2016 +0100

    remove already applied upstream patches
---
 debian/patches/series                              |  33 --
 .../0001-pv-fix-for-expires-variables.patch        |  45 ---
 ...-modules-lcr-backported-ruri_user_avp-fix.patch |  24 --
 ...bugger-Fix-coredump-when-kamailio-stopped.patch |  92 ------
 ...-updated-include-paths-for-libmysqlclient.patch | 190 -----------
 ...extended-log-message-when-hash-size-param.patch |  27 --
 ...use-NAME-compile-flag-for-default-path-to.patch |  29 --
 ...basic-documentation-for-params-and-functi.patch |  99 ------
 .../0008-app_python-readme-regenerated.patch       | 117 -------
 ...-test-of-return-code-for-add_interfaces-i.patch |  32 --
 ...justed-log-message-for-trying-to-import-t.patch |  30 --
 ...vim-added-recent-core-parameter-to-vim-sy.patch |  27 --
 ...le-fixing-htable.stats-for-max-slot-value.patch |  28 --
 ...ero-char-and-whitespaces-before-parsing-f.patch |  35 --
 ...proper-handling-of-socket-parameter-when-.patch |  52 ---
 ...it-variable-to-prevent-invalid-cleanup-on.patch |  29 --
 ...-cnxcc-define-inline-functions-in-cnxcc.h.patch |  87 -----
 .../upstream/0017-debugger-fix-issue-463.patch     |  44 ---
 ...18-tm-Reset-socket-variable-while-forking.patch |  28 --
 .../upstream/0019-fixed-correlation_id.patch       |  25 --
 ...sions-max-size-of-subnet-array-set-to-512.patch |  28 --
 ...ode-when-freeing-transactions-at-shutdown.patch |  67 ----
 ...t-free-tm-cell-still-linked-in-wait-timer.patch |  72 -----
 ...ef-counter-if-attempting-to-free-while-st.patch |  26 --
 ...route-fixed-possible-kamctl-fifo-segfault.patch |  35 --
 ...r-detection-of-cancel-reply-for-processin.patch |  28 --
 .../upstream/0026-dtrie-sanity-checks.patch        |  61 ----
 ...egression-introduced-with-detection-of-ip.patch |  39 ---
 ...i-static-declaration-for-inline-function-.patch |  38 ---
 ...removed-trailing-spaces-for-sane-git-diff.patch | 117 -------
 ...-username-when-querying-for-credentials-v.patch |  44 ---
 ...-check-for-target-buffer-size-before-copy.patch |  41 ---
 ...-pv-Fix-crash-when-xavp-has-no-attributes.patch |  27 --
 ...ils-change-names-colliding-with-libcrypto.patch | 352 ---------------------
 34 files changed, 2048 deletions(-)

diff --git a/debian/patches/series b/debian/patches/series
index baec7f9..bd738c2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,36 +1,3 @@
-upstream/0001-pv-fix-for-expires-variables.patch
-upstream/0002-modules-lcr-backported-ruri_user_avp-fix.patch
-upstream/0003-debugger-Fix-coredump-when-kamailio-stopped.patch
-upstream/0004-db_mysql-updated-include-paths-for-libmysqlclient.patch
-upstream/0005-dispatcher-extended-log-message-when-hash-size-param.patch
-upstream/0006-app_python-use-NAME-compile-flag-for-default-path-to.patch
-upstream/0007-app_python-basic-documentation-for-params-and-functi.patch
-upstream/0008-app_python-readme-regenerated.patch
-upstream/0009-core-proper-test-of-return-code-for-add_interfaces-i.patch
-upstream/0010-outbound-adjusted-log-message-for-trying-to-import-t.patch
-upstream/0011-utils-misc-vim-added-recent-core-parameter-to-vim-sy.patch
-upstream/0012-htable-fixing-htable.stats-for-max-slot-value.patch
-upstream/0013-core-skip-zero-char-and-whitespaces-before-parsing-f.patch
-upstream/0014-dispatcher-proper-handling-of-socket-parameter-when-.patch
-upstream/0015-presence-init-variable-to-prevent-invalid-cleanup-on.patch
-upstream/0016-cnxcc-define-inline-functions-in-cnxcc.h.patch
-upstream/0017-debugger-fix-issue-463.patch
-upstream/0018-tm-Reset-socket-variable-while-forking.patch
-upstream/0019-fixed-correlation_id.patch
-upstream/0020-permissions-max-size-of-subnet-array-set-to-512.patch
-upstream/0021-tm-silent-mode-when-freeing-transactions-at-shutdown.patch
-upstream/0022-tm-don-t-free-tm-cell-still-linked-in-wait-timer.patch
-upstream/0023-tm-reinit-ref-counter-if-attempting-to-free-while-st.patch
-upstream/0024-carrierroute-fixed-possible-kamctl-fifo-segfault.patch
-upstream/0025-topoh-proper-detection-of-cancel-reply-for-processin.patch
-upstream/0026-dtrie-sanity-checks.patch
-upstream/0027-corex-fix-regression-introduced-with-detection-of-ip.patch
-upstream/0028-presence_mwi-static-declaration-for-inline-function-.patch
-upstream/0029-auth_db-removed-trailing-spaces-for-sane-git-diff.patch
-upstream/0030-auth_db-use-username-when-querying-for-credentials-v.patch
-upstream/0031-seas-safety-check-for-target-buffer-size-before-copy.patch
-upstream/0032-pv-Fix-crash-when-xavp-has-no-attributes.patch
-upstream/0033-srutils-change-names-colliding-with-libcrypto.patch
 no_lib64_on_64_bits.patch
 no_INSTALL_file.patch
 fix_export.patch
diff --git a/debian/patches/upstream/0001-pv-fix-for-expires-variables.patch b/debian/patches/upstream/0001-pv-fix-for-expires-variables.patch
deleted file mode 100644
index cbe04ef..0000000
--- a/debian/patches/upstream/0001-pv-fix-for-expires-variables.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 583dc060e89b87bcba241edcedd8d48413640fc1 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Fri, 27 Nov 2015 14:35:51 +0100
-Subject: [PATCH 01/33] pv: fix for $expires() variables
-
-- invalid while iterator was used, resulting in crash
-- reported by Jayesh Nambiar
-
-(cherry picked from commit 3fe7fd27605ed9f506a95d11d4c88b78f22eadd1)
----
- modules/pv/pv_core.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/modules/pv/pv_core.c b/modules/pv/pv_core.c
-index 7c3aa92..e4a910b 100644
---- a/modules/pv/pv_core.c
-+++ b/modules/pv/pv_core.c
-@@ -3026,6 +3026,7 @@ int pv_get_expires(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
- 	unsigned int exp_max = 0;
- 	hdr_field_t* hdr;
- 	contact_t* c;
-+	contact_t* c0;
- 	unsigned int eval = 0;
- 	unsigned int ehdr = 0;
- 	unsigned int efound = 0;
-@@ -3056,7 +3057,7 @@ int pv_get_expires(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
- 				}
- 				c = ((contact_body_t*)hdr->parsed)->contacts;
- 				while(c) {
--					c = c->next;
-+					c0 = c->next;
- 					if(c->expires && c->expires->body.len) {
- 						if (str2int(&c->expires->body, &eval) < 0) {
- 							LM_ERR("failed to parse expires\n");
-@@ -3071,6 +3072,7 @@ int pv_get_expires(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
- 						if(eval>exp_max) exp_max = eval;
- 						if(eval<exp_min) exp_min = eval;
- 					}
-+					c = c0;
- 				}
- 			}
- 			hdr = hdr->next;
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0002-modules-lcr-backported-ruri_user_avp-fix.patch b/debian/patches/upstream/0002-modules-lcr-backported-ruri_user_avp-fix.patch
deleted file mode 100644
index 0acb694..0000000
--- a/debian/patches/upstream/0002-modules-lcr-backported-ruri_user_avp-fix.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 05ec88af66344c2897f34b51b0ca7fc6d66ee2a1 Mon Sep 17 00:00:00 2001
-From: Juha Heinanen <jh at tutpro.com>
-Date: Tue, 15 Dec 2015 00:15:07 +0200
-Subject: [PATCH 02/33] modules/lcr: backported ruri_user_avp fix
-
----
- modules/lcr/lcr_mod.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/modules/lcr/lcr_mod.c b/modules/lcr/lcr_mod.c
-index ae01b24..9f1da65 100644
---- a/modules/lcr/lcr_mod.c
-+++ b/modules/lcr/lcr_mod.c
-@@ -1829,6 +1829,7 @@ void add_gws_into_avps(struct gw_info *gws, struct matched_gw_info *matched_gws,
-     int_str val;
- 
-     delete_avp(gw_uri_avp_type|AVP_VAL_STR, gw_uri_avp);
-+    delete_avp(ruri_user_avp_type|AVP_VAL_STR, ruri_user_avp);
- 
-     for (i = 0; i < gw_cnt; i++) {
- 	if (matched_gws[i].duplicate == 1) continue;
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0003-debugger-Fix-coredump-when-kamailio-stopped.patch b/debian/patches/upstream/0003-debugger-Fix-coredump-when-kamailio-stopped.patch
deleted file mode 100644
index e18d14a..0000000
--- a/debian/patches/upstream/0003-debugger-Fix-coredump-when-kamailio-stopped.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From a562275acacb2bd98b075f3132ddbce8de456f41 Mon Sep 17 00:00:00 2001
-From: smititelu <stefan.mititelu at 1and1.ro>
-Date: Wed, 16 Dec 2015 13:28:18 +0200
-Subject: [PATCH 03/33] debugger: Fix coredump when kamailio stopped
-
-Upon kamailio stop, 'dbg_cfg' pointed to invalid memory zone(not NULL).
-Reset the pointer to NULL upon module_destroy() and do the NULL checks.
-
-Reported by foucse in issue #446.
-
-(cherry picked from commit 64583809c677384e2fcd54a5ba7f921b3ea59c51)
----
- modules/debugger/debugger_api.c |  4 ++++
- modules/debugger/debugger_mod.c | 16 +++++++++++++++-
- 2 files changed, 19 insertions(+), 1 deletion(-)
-
-diff --git a/modules/debugger/debugger_api.c b/modules/debugger/debugger_api.c
-index 05f904e..0f5f65d 100644
---- a/modules/debugger/debugger_api.c
-+++ b/modules/debugger/debugger_api.c
-@@ -1221,6 +1221,10 @@ int dbg_get_mod_debug_level(char *mname, int mnlen, int *mlevel)
- 	if(_dbg_mod_table==NULL)
- 		return -1;
- 
-+	if (!dbg_cfg) {
-+		return -1;
-+	}
-+
- 	if(cfg_get(dbg, dbg_cfg, mod_level_mode)==0)
- 		return -1;
- 
-diff --git a/modules/debugger/debugger_mod.c b/modules/debugger/debugger_mod.c
-index 496492f..468b882 100644
---- a/modules/debugger/debugger_mod.c
-+++ b/modules/debugger/debugger_mod.c
-@@ -141,10 +141,16 @@ static int mod_init(void)
- 		LM_ERR("Fail to declare the configuration\n");
- 		return -1;
- 	}
-+
- 	LM_DBG("cfg level_mode:%d hash_size:%d\n",
- 		cfg_get(dbg, dbg_cfg, mod_level_mode),
- 		cfg_get(dbg, dbg_cfg, mod_hash_size));
- 
-+	/* anyhow, should fail before */
-+	if (!dbg_cfg) {
-+                return -1;
-+	}
-+
- 	if(dbg_init_mod_levels(cfg_get(dbg, dbg_cfg, mod_hash_size))<0)
- 	{
- 		LM_ERR("failed to init per module log level\n");
-@@ -190,6 +196,7 @@ static int child_init(int rank)
-  */
- static void mod_destroy(void)
- {
-+	dbg_cfg = NULL;
- }
- 
- /**
-@@ -311,20 +318,27 @@ static int dbg_mod_level_param(modparam_t type, void *val)
- 	}
- 	s.s = (char*)val;
- 	s.len = p - s.s;
-+
-+	if (!dbg_cfg) {
-+                return -1;
-+	}
-+
- 	LM_DBG("cfg level_mode:%d hash_size:%d\n",
- 		cfg_get(dbg, dbg_cfg, mod_level_mode),
- 		cfg_get(dbg, dbg_cfg, mod_hash_size));
-+
- 	if(dbg_init_mod_levels(cfg_get(dbg, dbg_cfg, mod_hash_size))<0)
- 	{
- 		LM_ERR("failed to init per module log level\n");
- 		return -1;
- 	}
-+
- 	if(dbg_set_mod_debug_level(s.s, s.len, &l)<0)
- 	{
- 		LM_ERR("cannot store parameter: %s\n", (char*)val);
- 		return -1;
- 	}
-+
- 	return 0;
- 
- }
--
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0004-db_mysql-updated-include-paths-for-libmysqlclient.patch b/debian/patches/upstream/0004-db_mysql-updated-include-paths-for-libmysqlclient.patch
deleted file mode 100644
index 277f1c0..0000000
--- a/debian/patches/upstream/0004-db_mysql-updated-include-paths-for-libmysqlclient.patch
+++ /dev/null
@@ -1,190 +0,0 @@
-From 8c7ae98ed97c8d0655d0539cceadf1250cf5dfc3 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Fri, 27 Nov 2015 00:03:26 +0100
-Subject: [PATCH 04/33] db_mysql: updated include paths for libmysqlclient
-
-- direct use of mysql_config, the old substitution done in module
-  Makefile can break the includes of libmysqlclient files
-- reported by Ian Yu-Hsun Lin, GH#419
-
-(cherry picked from commit 2bd85c6b5020929296860074ca9a5dbc0cbde69c)
----
- modules/db_mysql/Makefile      | 2 +-
- modules/db_mysql/km_db_mysql.c | 2 +-
- modules/db_mysql/km_dbase.c    | 6 +++---
- modules/db_mysql/km_my_con.c   | 2 +-
- modules/db_mysql/km_my_con.h   | 2 +-
- modules/db_mysql/km_res.c      | 2 +-
- modules/db_mysql/km_val.h      | 2 +-
- modules/db_mysql/my_cmd.c      | 4 ++--
- modules/db_mysql/my_cmd.h      | 2 +-
- modules/db_mysql/my_con.h      | 2 +-
- modules/db_mysql/my_fld.h      | 2 +-
- modules/db_mysql/my_res.c      | 2 +-
- 12 files changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/modules/db_mysql/Makefile b/modules/db_mysql/Makefile
-index 1cea920..d9239e0 100644
---- a/modules/db_mysql/Makefile
-+++ b/modules/db_mysql/Makefile
-@@ -20,7 +20,7 @@ endif
- 
- ifneq ($(MYSQLCFG),)
- 	# use autodetection
--	DEFS += $(shell $(MYSQLCFG) --include | sed 's/\(-I[^ ]*\)\/mysql/\1/g' )
-+	DEFS += $(shell $(MYSQLCFG) --include)
- 	LIBS = $(shell $(MYSQLCFG) --libs)
- else
- 	# mysql.h locations (freebsd,openbsd  solaris)
-diff --git a/modules/db_mysql/km_db_mysql.c b/modules/db_mysql/km_db_mysql.c
-index 201c018..38cb66a 100644
---- a/modules/db_mysql/km_db_mysql.c
-+++ b/modules/db_mysql/km_db_mysql.c
-@@ -38,7 +38,7 @@
- #include "km_dbase.h"
- #include "km_db_mysql.h"
- 
--#include <mysql/mysql.h>
-+#include <mysql.h>
- 
- unsigned int db_mysql_timeout_interval = 2;   /* Default is 6 seconds */
- unsigned int db_mysql_auto_reconnect = 1;     /* Default is enabled   */
-diff --git a/modules/db_mysql/km_dbase.c b/modules/db_mysql/km_dbase.c
-index f1956e8..9b220c3 100644
---- a/modules/db_mysql/km_dbase.c
-+++ b/modules/db_mysql/km_dbase.c
-@@ -33,9 +33,9 @@
- 
- #include <stdio.h>
- #include <string.h>
--#include <mysql/mysql.h>
--#include <mysql/errmsg.h>
--#include <mysql/mysql_version.h>
-+#include <mysql.h>
-+#include <errmsg.h>
-+#include <mysql_version.h>
- #include "../../mem/mem.h"
- #include "../../dprint.h"
- #include "../../async_task.h"
-diff --git a/modules/db_mysql/km_my_con.c b/modules/db_mysql/km_my_con.c
-index d5f4dd2..94775f4 100644
---- a/modules/db_mysql/km_my_con.c
-+++ b/modules/db_mysql/km_my_con.c
-@@ -28,7 +28,7 @@
- 
- #include "km_my_con.h"
- #include "km_db_mysql.h"
--#include <mysql/mysql_version.h>
-+#include <mysql_version.h>
- #include "../../mem/mem.h"
- #include "../../dprint.h"
- #include "../../ut.h"
-diff --git a/modules/db_mysql/km_my_con.h b/modules/db_mysql/km_my_con.h
-index 45fed57..ada6314 100644
---- a/modules/db_mysql/km_my_con.h
-+++ b/modules/db_mysql/km_my_con.h
-@@ -34,7 +34,7 @@
- #include "../../lib/srdb1/db_id.h"
- 
- #include <time.h>
--#include <mysql/mysql.h>
-+#include <mysql.h>
- 
- 
- struct my_con {
-diff --git a/modules/db_mysql/km_res.c b/modules/db_mysql/km_res.c
-index c7dbb9e..95cd7fa 100644
---- a/modules/db_mysql/km_res.c
-+++ b/modules/db_mysql/km_res.c
-@@ -30,7 +30,7 @@
- 
- 
- #include <string.h>
--#include <mysql/mysql.h>
-+#include <mysql.h>
- #include "../../lib/srdb1/db_res.h"
- #include "../../mem/mem.h"
- #include "../../dprint.h"
-diff --git a/modules/db_mysql/km_val.h b/modules/db_mysql/km_val.h
-index 345541b..68cee00 100644
---- a/modules/db_mysql/km_val.h
-+++ b/modules/db_mysql/km_val.h
-@@ -29,7 +29,7 @@
- #ifndef KM_VAL_H
- #define KM_VAL_H
- 
--#include <mysql/mysql.h>
-+#include <mysql.h>
- #include "../../lib/srdb1/db_val.h"
- #include "../../lib/srdb1/db.h"
- 
-diff --git a/modules/db_mysql/my_cmd.c b/modules/db_mysql/my_cmd.c
-index 666692c..61b3c61 100644
---- a/modules/db_mysql/my_cmd.c
-+++ b/modules/db_mysql/my_cmd.c
-@@ -46,8 +46,8 @@
- #include <stdio.h>
- #include <time.h>  /*strptime, XOPEN issue must be >=4 */
- #include <string.h>
--#include <mysql/errmsg.h>
--#include <mysql/mysqld_error.h>
-+#include <errmsg.h>
-+#include <mysqld_error.h>
- 
- #define STR_BUF_SIZE 1024
- 
-diff --git a/modules/db_mysql/my_cmd.h b/modules/db_mysql/my_cmd.h
-index d8a3d64..36b1f67 100644
---- a/modules/db_mysql/my_cmd.h
-+++ b/modules/db_mysql/my_cmd.h
-@@ -24,7 +24,7 @@
- 
- #include "../../lib/srdb2/db_drv.h"
- #include "../../lib/srdb2/db_cmd.h"
--#include <mysql/mysql.h>
-+#include <mysql.h>
- #include <stdarg.h>
- 
- typedef enum my_flags {
-diff --git a/modules/db_mysql/my_con.h b/modules/db_mysql/my_con.h
-index 7194320..2d773cf 100644
---- a/modules/db_mysql/my_con.h
-+++ b/modules/db_mysql/my_con.h
-@@ -27,7 +27,7 @@
- #include "../../lib/srdb2/db_uri.h"
- 
- #include <time.h>
--#include <mysql/mysql.h>
-+#include <mysql.h>
- 
- enum my_con_flags {
- 	MY_CONNECTED = 1
-diff --git a/modules/db_mysql/my_fld.h b/modules/db_mysql/my_fld.h
-index 0a024ce..79a9fb1 100644
---- a/modules/db_mysql/my_fld.h
-+++ b/modules/db_mysql/my_fld.h
-@@ -28,7 +28,7 @@
- 
- #include "../../lib/srdb2/db_drv.h"
- #include "../../lib/srdb2/db_fld.h"
--#include <mysql/mysql.h>
-+#include <mysql.h>
- 
- struct my_fld {
- 	db_drv_t gen;
-diff --git a/modules/db_mysql/my_res.c b/modules/db_mysql/my_res.c
-index 0c93d40..83ee74f 100644
---- a/modules/db_mysql/my_res.c
-+++ b/modules/db_mysql/my_res.c
-@@ -27,7 +27,7 @@
- #include "../../dprint.h"
- #include "../../lib/srdb2/db_gen.h"
- 
--#include <mysql/mysql.h>
-+#include <mysql.h>
- 
- 
- void my_res_free(db_res_t* res, struct my_res* payload)
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0005-dispatcher-extended-log-message-when-hash-size-param.patch b/debian/patches/upstream/0005-dispatcher-extended-log-message-when-hash-size-param.patch
deleted file mode 100644
index b2646cc..0000000
--- a/debian/patches/upstream/0005-dispatcher-extended-log-message-when-hash-size-param.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 03f99c65f016da8816f6367ad3cafd75f89fc712 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Wed, 2 Dec 2015 23:10:57 +0100
-Subject: [PATCH 05/33] dispatcher: extended log message when hash size
- parameter is not set
-
-(cherry picked from commit 3272ff6a427ce5bb60d767ed61c8cadd13759de1)
----
- modules/dispatcher/dispatcher.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/modules/dispatcher/dispatcher.c b/modules/dispatcher/dispatcher.c
-index c75b97d..4787049 100644
---- a/modules/dispatcher/dispatcher.c
-+++ b/modules/dispatcher/dispatcher.c
-@@ -514,7 +514,7 @@ static int mod_init(void)
- 			register_timer(ds_ht_timer, NULL, ds_hash_check_interval);
- 		} else {
- 			LM_ERR("call load dispatching DSTID_AVP set but no size"
--					" for hash table\n");
-+					" for hash table (see ds_hash_size parameter)\n");
- 			return -1;
- 		}
- 	}
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0006-app_python-use-NAME-compile-flag-for-default-path-to.patch b/debian/patches/upstream/0006-app_python-use-NAME-compile-flag-for-default-path-to.patch
deleted file mode 100644
index 570b324..0000000
--- a/debian/patches/upstream/0006-app_python-use-NAME-compile-flag-for-default-path-to.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 768be33037f8eefeb3a841e030d3bb3f1be4bb9e Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Thu, 3 Dec 2015 12:29:49 +0100
-Subject: [PATCH 06/33] app_python: use NAME compile flag for default path to
- the script
-
-- reflects better the application name
-
-(cherry picked from commit 6ae155ee8ebc0d52fd63f208e57808c1d228f7e0)
----
- modules/app_python/python_mod.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/modules/app_python/python_mod.c b/modules/app_python/python_mod.c
-index f297069..7cc7a2e 100644
---- a/modules/app_python/python_mod.c
-+++ b/modules/app_python/python_mod.c
-@@ -39,7 +39,7 @@
- MODULE_VERSION
- 
- 
--static str script_name = str_init("/usr/local/etc/sip-router/handler.py");
-+static str script_name = str_init("/usr/local/etc/" NAME "/handler.py");
- static str mod_init_fname = str_init("mod_init");
- static str child_init_mname = str_init("child_init");
- 
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0007-app_python-basic-documentation-for-params-and-functi.patch b/debian/patches/upstream/0007-app_python-basic-documentation-for-params-and-functi.patch
deleted file mode 100644
index d16bdf8..0000000
--- a/debian/patches/upstream/0007-app_python-basic-documentation-for-params-and-functi.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From cf77d88069407512c7d2ff234607ab6e3fc9c784 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Thu, 3 Dec 2015 12:31:01 +0100
-Subject: [PATCH 07/33] app_python: basic documentation for params and
- functions
-
-- based on quick look at the code
-
-(cherry picked from commit e2853a8ac22bc26d47153731f65479f03a756c52)
----
- modules/app_python/doc/app_python_admin.xml | 28 +++++++++++++++++++---------
- 1 file changed, 19 insertions(+), 9 deletions(-)
-
-diff --git a/modules/app_python/doc/app_python_admin.xml b/modules/app_python/doc/app_python_admin.xml
-index 56aa4df..ef726c4 100644
---- a/modules/app_python/doc/app_python_admin.xml
-+++ b/modules/app_python/doc/app_python_admin.xml
-@@ -20,6 +20,11 @@
- 		This module allows executing Python scripts from config file,
- 		exporting functions to access the SIP message from Python.
- 	</para>
-+	<para>
-+		For some basic examples of Python scripts that can be used with
-+		this module, look at the files inside source tree located at
-+		'modules/app_python/python_examples/'.
-+	</para>
-     </section>
-     <section>
- 	<title>Dependencies</title>
-@@ -56,18 +61,19 @@
- 	<section>
- 	    <title><varname>script_name</varname> (string)</title>
- 	    <para>
--			TBD.
-+			The path to the fiel with Python code to be executed
-+			from configuration file.
- 	    </para>
- 	    <para>
- 		<emphasis>
--		    Default value is <quote>/usr/local/etc/sip-router/handler.py</quote>.
-+		    Default value is <quote>/usr/local/etc/kamailio/handler.py</quote>.
- 		</emphasis>
- 	    </para>
- 	    <example>
- 		<title>Set <varname>script_name</varname> parameter</title>
- 		<programlisting format="linespecific">
- ...
--modparam("app_python", "script_name", "/usr/local/etc/sip-router/myscript.py")
-+modparam("app_python", "script_name", "/usr/local/etc/kamailio/myscript.py")
- ...
- </programlisting>
- 	    </example>
-@@ -76,7 +82,8 @@ modparam("app_python", "script_name", "/usr/local/etc/sip-router/myscript.py")
- 	<section>
- 	    <title><varname>mod_init_function</varname> (string)</title>
- 	    <para>
--			TBD.
-+			The Python function to be executed by this module when
-+			it is initialied by &kamailio;.
- 	    </para>
- 	    <para>
- 		<emphasis>
-@@ -96,7 +103,8 @@ modparam("app_python", "mod_init_function", "my_mod_init")
- 	<section>
- 	    <title><varname>child_init_method</varname> (string)</title>
- 	    <para>
--			TBD.
-+			The Python function to be executed by this module when
-+			a new worker process (child) is initialied by &kamailio;.
- 	    </para>
- 	    <para>
- 		<emphasis>
-@@ -119,17 +127,19 @@ modparam("app_python", "child_init_method", "my_child_init")
- 	<title>Functions</title>
-  	<section>
- 	    <title>
--		<function moreinfo="none">python_exec(method [, mystr])</function>
-+		<function moreinfo="none">python_exec(method [, args])</function>
- 	    </title>
- 	    <para>
--		TBD.
-+			Execute the Python function with the name given by the parameter 'method'.
-+			Optionally can be provided a second string with parameters to be passed
-+			to the Python function.
- 	    </para>
- 		<example>
- 		<title><function>python_exec</function> usage</title>
- 		<programlisting format="linespecific">
- ...
--python_exec("...");
--python_exec("...", "...");
-+python_exec("my_python_function");
-+python_exec("my_python_function", "my_params");
- ...
- </programlisting>
- 	    </example>
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0008-app_python-readme-regenerated.patch b/debian/patches/upstream/0008-app_python-readme-regenerated.patch
deleted file mode 100644
index f1b5ea5..0000000
--- a/debian/patches/upstream/0008-app_python-readme-regenerated.patch
+++ /dev/null
@@ -1,117 +0,0 @@
-From 7dd019826dccf6c3c5d2185faf331603b550f895 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Thu, 3 Dec 2015 12:31:39 +0100
-Subject: [PATCH 08/33] app_python: readme regenerated
-
-(cherry picked from commit f025df7a0ac292bd22304683dd976863311b53cd)
----
- modules/app_python/README | 39 ++++++++++++++++++++++++---------------
- 1 file changed, 24 insertions(+), 15 deletions(-)
-
-diff --git a/modules/app_python/README b/modules/app_python/README
-index 770b9f7..243f9cc 100644
---- a/modules/app_python/README
-+++ b/modules/app_python/README
-@@ -6,7 +6,7 @@ Edited by
- 
- Maxim Sobolev
- 
--   Copyright © 2010 Maxim Sobolev
-+   Copyright � 2010 Maxim Sobolev
-      __________________________________________________________________
- 
-    Table of Contents
-@@ -27,7 +27,7 @@ Maxim Sobolev
- 
-         4. Functions
- 
--              4.1. python_exec(method [, mystr])
-+              4.1. python_exec(method [, args])
- 
-    List of Examples
- 
-@@ -54,13 +54,17 @@ Chapter 1. Admin Guide
- 
-    4. Functions
- 
--        4.1. python_exec(method [, mystr])
-+        4.1. python_exec(method [, args])
- 
- 1. Overview
- 
-    This module allows executing Python scripts from config file, exporting
-    functions to access the SIP message from Python.
- 
-+   For some basic examples of Python scripts that can be used with this
-+   module, look at the files inside source tree located at
-+   'modules/app_python/python_examples/'.
-+
- 2. Dependencies
- 
-    2.1. Kamailio Modules
-@@ -85,20 +89,22 @@ Chapter 1. Admin Guide
- 
- 3.1. script_name (string)
- 
--   TBD.
-+   The path to the fiel with Python code to be executed from configuration
-+   file.
- 
--   Default value is “/usr/local/etc/sip-router/handler.py”.
-+   Default value is "/usr/local/etc/kamailio/handler.py".
- 
-    Example 1.1. Set script_name parameter
- ...
--modparam("app_python", "script_name", "/usr/local/etc/sip-router/myscript.py")
-+modparam("app_python", "script_name", "/usr/local/etc/kamailio/myscript.py")
- ...
- 
- 3.2. mod_init_function (string)
- 
--   TBD.
-+   The Python function to be executed by this module when it is initialied
-+   by Kamailio.
- 
--   Default value is “mod_init”.
-+   Default value is "mod_init".
- 
-    Example 1.2. Set mod_init_function parameter
- ...
-@@ -107,9 +113,10 @@ modparam("app_python", "mod_init_function", "my_mod_init")
- 
- 3.3. child_init_method (string)
- 
--   TBD.
-+   The Python function to be executed by this module when a new worker
-+   process (child) is initialied by Kamailio.
- 
--   Default value is “child_init”.
-+   Default value is "child_init".
- 
-    Example 1.3. Set child_init_method parameter
- ...
-@@ -118,14 +125,16 @@ modparam("app_python", "child_init_method", "my_child_init")
- 
- 4. Functions
- 
--   4.1. python_exec(method [, mystr])
-+   4.1. python_exec(method [, args])
- 
--4.1.  python_exec(method [, mystr])
-+4.1. python_exec(method [, args])
- 
--   TBD.
-+   Execute the Python function with the name given by the parameter
-+   'method'. Optionally can be provided a second string with parameters to
-+   be passed to the Python function.
- 
-    Example 1.4. python_exec usage
- ...
--python_exec("...");
--python_exec("...", "...");
-+python_exec("my_python_function");
-+python_exec("my_python_function", "my_params");
- ...
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0009-core-proper-test-of-return-code-for-add_interfaces-i.patch b/debian/patches/upstream/0009-core-proper-test-of-return-code-for-add_interfaces-i.patch
deleted file mode 100644
index 089898c..0000000
--- a/debian/patches/upstream/0009-core-proper-test-of-return-code-for-add_interfaces-i.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 6516699e46bd912de3b65d4cc4eb668e919e845e Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Thu, 3 Dec 2015 13:24:40 +0100
-Subject: [PATCH 09/33] core: proper test of return code for add_interfaces()
- in case of IPv6
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-- report with patch by Christian Kühnke
-
-(cherry picked from commit 299d2f7764527fbc5b6de1833976f43c58b1ff2d)
----
- socket_info.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/socket_info.c b/socket_info.c
-index 75d09da..678b6d8 100644
---- a/socket_info.c
-+++ b/socket_info.c
-@@ -1809,7 +1809,7 @@ int fix_all_socket_lists()
- #ifdef __OS_linux
- 		&&  (!auto_bind_ipv6 || add_interfaces_via_netlink(0, AF_INET6, 0, PROTO_UDP, &ai_lst) == 0)
- #else
--		&& ( !auto_bind_ipv6 || add_interfaces(0, AF_INET6, 0,  PROTO_UDP, &ai_lst) !=0 ) /* add_interface does not work for IPv6 on Linux */
-+		&& ( !auto_bind_ipv6 || add_interfaces(0, AF_INET6, 0,  PROTO_UDP, &ai_lst) ==0 ) /* add_interface does not work for IPv6 on Linux */
- #endif /* __OS_linux */
- 			 ) && (addr_info_to_si_lst(ai_lst, 0, PROTO_UDP, 0, &udp_listen)==0)){
- 			free_addr_info_lst(&ai_lst);
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0010-outbound-adjusted-log-message-for-trying-to-import-t.patch b/debian/patches/upstream/0010-outbound-adjusted-log-message-for-trying-to-import-t.patch
deleted file mode 100644
index 4cde2e0..0000000
--- a/debian/patches/upstream/0010-outbound-adjusted-log-message-for-trying-to-import-t.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From a350e33b3fe13e807a621d12325342c93c4ab706 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Fri, 4 Dec 2015 17:30:06 +0100
-Subject: [PATCH 10/33] outbound: adjusted log message for trying to import the
- api
-
-- when module is not loaded, a messages with 'failed' was printed,
-  which could trigger an alert even for info level
-
-(cherry picked from commit 700617c6b3707fba16001f82fab6ca0370b23acf)
----
- modules/outbound/api.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/modules/outbound/api.h b/modules/outbound/api.h
-index b8ed738..bc80589 100644
---- a/modules/outbound/api.h
-+++ b/modules/outbound/api.h
-@@ -51,7 +51,7 @@ inline static int ob_load_api(ob_api_t *pxb)
- 	bind_ob_f bind_ob_exports;
- 	if (!(bind_ob_exports = (bind_ob_f)find_export("bind_ob", 1, 0)))
- 	{
--		LM_INFO("Failed to import bind_ob\n");
-+		LM_INFO("unable to import bind_ob - maybe module is not loaded\n");
- 		return -1;
- 	}
- 	return bind_ob_exports(pxb);
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0011-utils-misc-vim-added-recent-core-parameter-to-vim-sy.patch b/debian/patches/upstream/0011-utils-misc-vim-added-recent-core-parameter-to-vim-sy.patch
deleted file mode 100644
index 2d16da1..0000000
--- a/debian/patches/upstream/0011-utils-misc-vim-added-recent-core-parameter-to-vim-sy.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 1b2dee301ba6da206fcd9abb3b2f3f1a601b145c Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Fri, 4 Dec 2015 23:02:53 +0100
-Subject: [PATCH 11/33] utils/misc/vim: added recent core parameter to vim
- syntax highlighting
-
-(cherry picked from commit f9d16e38dbf6b263fc29dceca66007357a9e6f37)
----
- utils/misc/vim/syntax/kamailio.vim | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/utils/misc/vim/syntax/kamailio.vim b/utils/misc/vim/syntax/kamailio.vim
-index 01eeb72..6bad5f7 100644
---- a/utils/misc/vim/syntax/kamailio.vim
-+++ b/utils/misc/vim/syntax/kamailio.vim
-@@ -53,7 +53,7 @@ syn keyword kamailioCoreValue		udp UDP tcp TCP tls TLS sctp SCTP ws WS wss WSS i
- 
- syn keyword	kamailioCoreFunction	forward forward_tcp forward_udp forward_tls forward_sctp send send_tcp log error exec force_rport add_rport force_tcp_alias add_tcp_alias udp_mtu udp_mtu_try_proto setflag resetflag isflagset flags bool setavpflag resetavpflag isavpflagset avpflags rewritehost sethost seth rewritehostport sethostport sethp rewritehostporttrans sethostporttrans sethpt rewriteuser setuser setu rewriteuserpass setuserpass setup rewriteport setport setp rewriteuri seturi rev [...]
- 
--syn keyword	kamailioCoreParameter debug fork log_stderror log_facility log_name log_color log_prefix listen alias auto_aliases dns rev_dns dns_try_ipv6 dns_try_naptr dns_srv_lb dns_srv_loadbalancing dns_udp_pref dns_udp_preference dns_tcp_pref dns_tcp_preference dns_tls_pref dns_tls_preference dns_sctp_pref dns_sctp_preference dns_retr_time dns_retr_no dns_servers_no dns_use_search_list dns_search_full_match dns_cache_init use_dns_cache use_dns_failover dns_cache_flags dns_cache_negativ [...]
-+syn keyword	kamailioCoreParameter debug fork log_stderror log_facility log_name log_color log_prefix listen alias auto_aliases dns rev_dns dns_try_ipv6 dns_try_naptr dns_srv_lb dns_srv_loadbalancing dns_udp_pref dns_udp_preference dns_tcp_pref dns_tcp_preference dns_tls_pref dns_tls_preference dns_sctp_pref dns_sctp_preference dns_retr_time dns_retr_no dns_servers_no dns_use_search_list dns_search_full_match dns_cache_init use_dns_cache use_dns_failover dns_cache_flags dns_cache_negativ [...]
- 
- syn region	kamailioBlock	start='{' end='}' contained contains=kamailioBlock, at kamailioCodeElements
- 
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0012-htable-fixing-htable.stats-for-max-slot-value.patch b/debian/patches/upstream/0012-htable-fixing-htable.stats-for-max-slot-value.patch
deleted file mode 100644
index a887140..0000000
--- a/debian/patches/upstream/0012-htable-fixing-htable.stats-for-max-slot-value.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d4613882da9b478dcb8f01cc38dd9319694c5901 Mon Sep 17 00:00:00 2001
-From: Dmitri Savolainen <savolainen at erinaco.ru>
-Date: Wed, 9 Dec 2015 15:44:03 +0300
-Subject: [PATCH 12/33] htable: fixing htable.stats for max slot value
-
-add missed 'd' parameter to rpc->struct_add format string
-
-(cherry picked from commit 305381bb6b40dc4859f0862411a0c1a261b476c2)
----
- modules/htable/htable.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/modules/htable/htable.c b/modules/htable/htable.c
-index 0a31fd7..88ae0e3 100644
---- a/modules/htable/htable.c
-+++ b/modules/htable/htable.c
-@@ -1102,7 +1102,7 @@ static void  htable_rpc_stats(rpc_t* rpc, void* c)
- 			ht_slot_unlock(ht, i);
- 		}
- 
--		if(rpc->struct_add(th, "Sddd",
-+		if(rpc->struct_add(th, "Sdddd",
- 						"name", &ht->name,	/* str */
- 						"slots", (int)ht->htsize,	/* uint */
- 						"all", (int)all,	/* uint */
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0013-core-skip-zero-char-and-whitespaces-before-parsing-f.patch b/debian/patches/upstream/0013-core-skip-zero-char-and-whitespaces-before-parsing-f.patch
deleted file mode 100644
index 4b8846e..0000000
--- a/debian/patches/upstream/0013-core-skip-zero-char-and-whitespaces-before-parsing-f.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 8807dbc93a3731cb51a979158433fc28ff0c04ee Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Wed, 9 Dec 2015 23:27:09 +0100
-Subject: [PATCH 13/33] core: skip zero char and whitespaces before parsing
- first line in parse_msg()
-
-- reported by Vasiliy Ganchev
-
-(cherry picked from commit 12160de3c2052c4696b8c073b9fa5919f6da7060)
----
- parser/msg_parser.c | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/parser/msg_parser.c b/parser/msg_parser.c
-index b907772..21b3cc2 100644
---- a/parser/msg_parser.c
-+++ b/parser/msg_parser.c
-@@ -589,9 +589,11 @@ int parse_msg(char* const buf, const unsigned int len, struct sip_msg* const msg
- 	int offset;
- 	hdr_flags_t flags;
- 
--	/* eat crlf from the beginning */
--	for (tmp=buf; (*tmp=='\n' || *tmp=='\r')&&
--			tmp-buf < len ; tmp++);
-+	/* eat crlf & whitespaces from the beginning */
-+	for (tmp=buf; (tmp-buf < len)
-+			&& (*tmp=='\n' || *tmp=='\r' || *tmp=='\0'
-+				|| *tmp=='\t' || *tmp==' ');
-+			tmp++);
- 	offset=tmp-buf;
- 	fl=&(msg->first_line);
- 	rest=parse_first_line(tmp, len-offset, fl);
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0014-dispatcher-proper-handling-of-socket-parameter-when-.patch b/debian/patches/upstream/0014-dispatcher-proper-handling-of-socket-parameter-when-.patch
deleted file mode 100644
index 07ef535..0000000
--- a/debian/patches/upstream/0014-dispatcher-proper-handling-of-socket-parameter-when-.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From c4adb485cf19e2961845c0074949126a74de4fd8 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Thu, 10 Dec 2015 09:33:32 +0100
-Subject: [PATCH 14/33] dispatcher: proper handling of socket parameter when is
- not last in attrs
-
-- parsing socket function expects a null terminated string
-
-(cherry picked from commit fd79adb4975fc0799fe8488d1dd1a771041a0939)
----
- modules/dispatcher/dispatch.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c
-index a5f8a2a..a0582b6 100644
---- a/modules/dispatcher/dispatch.c
-+++ b/modules/dispatcher/dispatch.c
-@@ -241,6 +241,7 @@ int add_dest2list(int id, str uri, int flags, int priority, str *attrs,
- 	int orig_id = 0, orig_nr = 0;
- 	str host;
- 	int port, proto;
-+	char c = 0;
- 	ds_set_t *orig_ds_lists = ds_lists[list_idx];
- 
- 	/* check uri */
-@@ -315,11 +316,23 @@ int add_dest2list(int id, str uri, int flags, int priority, str *attrs,
- 
- 	/* check socket attribute */
- 	if (dp->attrs.socket.s && dp->attrs.socket.len > 0) {
-+		/* parse_phostport(...) expects 0-terminated string
-+		 * - after socket parameter is either ';' or '\0' */
-+		if(dp->attrs.socket.s[dp->attrs.socket.len]!='\0') {
-+			c = dp->attrs.socket.s[dp->attrs.socket.len];
-+			dp->attrs.socket.s[dp->attrs.socket.len] = '\0';
-+		}
- 		if (parse_phostport(dp->attrs.socket.s, &host.s, &host.len,
- 				&port, &proto)!=0) {
- 			LM_ERR("bad socket <%.*s>\n", dp->attrs.socket.len, dp->attrs.socket.s);
-+			if(c!=0) {
-+				dp->attrs.socket.s[dp->attrs.socket.len] = c;
-+			}
- 			goto err;
- 		}
-+		if(c!=0) {
-+			dp->attrs.socket.s[dp->attrs.socket.len] = c;
-+		}
- 		dp->sock = grep_sock_info( &host, (unsigned short)port, proto);
- 		if (dp->sock==0) {
- 			LM_ERR("non-local socket <%.*s>\n", dp->attrs.socket.len, dp->attrs.socket.s);
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0015-presence-init-variable-to-prevent-invalid-cleanup-on.patch b/debian/patches/upstream/0015-presence-init-variable-to-prevent-invalid-cleanup-on.patch
deleted file mode 100644
index 3209d0b..0000000
--- a/debian/patches/upstream/0015-presence-init-variable-to-prevent-invalid-cleanup-on.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From b9d441c1177bf2d05e1ca85919a08b6e97b3b302 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Mon, 14 Dec 2015 16:40:03 +0100
-Subject: [PATCH 15/33] presence: init variable to prevent invalid cleanup on
- error getting presence document
-
-- reported by GH#441
-
-(cherry picked from commit d24863d071417effe5df863736ef037ec8e0b414)
----
- modules/presence/publish.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/modules/presence/publish.c b/modules/presence/publish.c
-index 5a48f77..73a64c6 100644
---- a/modules/presence/publish.c
-+++ b/modules/presence/publish.c
-@@ -509,7 +509,7 @@ error:
- int update_hard_presentity(str *pres_uri, pres_ev_t *event, str *file_uri, str *filename)
- {
- 	int ret = -1, new_t, pidf_result;
--	str *pidf_doc;
-+	str *pidf_doc = 0;
- 	char *sphere = NULL;
- 	presentity_t *pres = NULL;
- 	struct sip_uri parsed_uri;
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0016-cnxcc-define-inline-functions-in-cnxcc.h.patch b/debian/patches/upstream/0016-cnxcc-define-inline-functions-in-cnxcc.h.patch
deleted file mode 100644
index 1a8b7dc..0000000
--- a/debian/patches/upstream/0016-cnxcc-define-inline-functions-in-cnxcc.h.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From fc11bd1c10ca08eb9f49a99174e85c0c549fba7f Mon Sep 17 00:00:00 2001
-From: grumvalski <federico.cabiddu at gmail.com>
-Date: Tue, 22 Dec 2015 13:48:19 +0100
-Subject: [PATCH 16/33] cnxcc: define inline functions in cnxcc.h
-
-(cherry picked from commit a9ec529ecee015e79dc60cb8ba8a6686cdf73a7b)
----
- modules/cnxcc/cnxcc.c | 24 ------------------------
- modules/cnxcc/cnxcc.h | 27 ++++++++++++++++++++++++---
- 2 files changed, 24 insertions(+), 27 deletions(-)
-
-diff --git a/modules/cnxcc/cnxcc.c b/modules/cnxcc/cnxcc.c
-index e869af4..3d21b3d 100644
---- a/modules/cnxcc/cnxcc.c
-+++ b/modules/cnxcc/cnxcc.c
-@@ -28,30 +28,6 @@
- 
- #include "cnxcc.h"
- 
--inline void get_datetime(str *dest)
--{
--	timestamp2isodt(dest, get_current_timestamp());
--}
--
--inline unsigned int get_current_timestamp()
--{
--	return time(NULL);
--}
--
--inline int timestamp2isodt(str *dest, unsigned int timestamp)
--{
--	time_t  		tim;
--	struct tm 		*tmPtr;
--
--	tim 		= timestamp;
--	tmPtr 		= localtime(&tim);
--
--	strftime( dest->s, DATETIME_SIZE, "%Y-%m-%d %H:%M:%S", tmPtr);
--	dest->len	= DATETIME_LENGTH;
--
--	return 0;
--}
--
- double str2double(str *string)
- {
- 	char buffer[string->len + 1];
-diff --git a/modules/cnxcc/cnxcc.h b/modules/cnxcc/cnxcc.h
-index 9454e16..3973eab 100644
---- a/modules/cnxcc/cnxcc.h
-+++ b/modules/cnxcc/cnxcc.h
-@@ -31,9 +31,30 @@
- #define DATETIME_LENGTH		DATETIME_SIZE - 1
- 
- 
--inline void get_datetime(str *dest);
--inline unsigned int get_current_timestamp();
--inline int timestamp2isodt(str *dest, unsigned int timestamp);
-+static inline unsigned int get_current_timestamp()
-+{
-+	return time(NULL);
-+}
-+
-+static inline int timestamp2isodt(str *dest, unsigned int timestamp)
-+{
-+	time_t  		tim;
-+	struct tm 		*tmPtr;
-+
-+	tim 		= timestamp;
-+	tmPtr 		= localtime(&tim);
-+
-+	strftime( dest->s, DATETIME_SIZE, "%Y-%m-%d %H:%M:%S", tmPtr);
-+	dest->len	= DATETIME_LENGTH;
-+
-+	return 0;
-+}
-+
-+static inline void get_datetime(str *dest)
-+{
-+	timestamp2isodt(dest, get_current_timestamp());
-+}
-+
- double str2double(str *string);
- 
- #endif /* _CNXCC_H */
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0017-debugger-fix-issue-463.patch b/debian/patches/upstream/0017-debugger-fix-issue-463.patch
deleted file mode 100644
index 1061351..0000000
--- a/debian/patches/upstream/0017-debugger-fix-issue-463.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From a45378496c5a1da347e569f7a58b78cfea8004e8 Mon Sep 17 00:00:00 2001
-From: Stefan Mititelu <stefan.mititelu at 1and1.ro>
-Date: Thu, 7 Jan 2016 09:58:42 +0200
-Subject: [PATCH 17/33] debugger: fix issue #463
-
-Don't shm_malloc() while the lock is taken.
-
-(cherry picked from commit 3668618369a8a1db8cb3410c0a7f50ce74150cd2)
----
- modules/debugger/debugger_api.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/modules/debugger/debugger_api.c b/modules/debugger/debugger_api.c
-index 0f5f65d..19d13c1 100644
---- a/modules/debugger/debugger_api.c
-+++ b/modules/debugger/debugger_api.c
-@@ -1178,15 +1178,14 @@ int dbg_set_mod_debug_level(char *mname, int mnlen, int *mlevel)
- 		itp = it;
- 		it = it->next;
- 	}
-+	lock_release(&_dbg_mod_table[idx].lock);
- 	/* not found - add */
- 	if(mlevel==NULL) {
--		lock_release(&_dbg_mod_table[idx].lock);
- 		return 0;
- 	}
- 	itn = (dbg_mod_level_t*)shm_malloc(sizeof(dbg_mod_level_t) + (mnlen+1)*sizeof(char));
- 	if(itn==NULL) {
- 		LM_ERR("no more shm\n");
--		lock_release(&_dbg_mod_table[idx].lock);
- 		return -1;
- 	}
- 	memset(itn, 0, sizeof(dbg_mod_level_t) + (mnlen+1)*sizeof(char));
-@@ -1197,6 +1196,7 @@ int dbg_set_mod_debug_level(char *mname, int mnlen, int *mlevel)
- 	strncpy(itn->name.s, mname, mnlen);
- 	itn->name.s[itn->name.len] = '\0';
- 
-+	lock_get(&_dbg_mod_table[idx].lock);
- 	if(itp==NULL) {
- 		itn->next = _dbg_mod_table[idx].first;
- 		_dbg_mod_table[idx].first = itn;
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0018-tm-Reset-socket-variable-while-forking.patch b/debian/patches/upstream/0018-tm-Reset-socket-variable-while-forking.patch
deleted file mode 100644
index 2c1d3ad..0000000
--- a/debian/patches/upstream/0018-tm-Reset-socket-variable-while-forking.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From e393ad5e9a7e52f830b4155a42a63eef6b0dc057 Mon Sep 17 00:00:00 2001
-From: Hugh Waite <hugh.waite at xura.com>
-Date: Thu, 7 Jan 2016 12:17:03 +0000
-Subject: [PATCH 18/33] tm: Reset socket variable while forking - Reset
- sock_str variable so values from previous forks are not stored in
- contact_flows AVP (cherry picked from commit
- 53263a2ddad9bb118763516bcd7995652c4fb070)
-
----
- modules/tm/t_serial.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/modules/tm/t_serial.c b/modules/tm/t_serial.c
-index b278924..2fb734f 100644
---- a/modules/tm/t_serial.c
-+++ b/modules/tm/t_serial.c
-@@ -626,6 +626,8 @@ int t_next_contacts(struct sip_msg* msg, char* key, char* value)
- 			}
- 		} else {
- 			sock = NULL;
-+			sock_str.s = 0;
-+			sock_str.len = 0;
- 		}
- 
- 		vavp = xavp_get(&flags_name, xavp->val.v.xavp);
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0019-fixed-correlation_id.patch b/debian/patches/upstream/0019-fixed-correlation_id.patch
deleted file mode 100644
index d53a9e3..0000000
--- a/debian/patches/upstream/0019-fixed-correlation_id.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 192abad8686e5fa9ffc65b5a42dbad6c16cce440 Mon Sep 17 00:00:00 2001
-From: Alexandr Dubovikov <alexandr.dubovikov at gmail.com>
-Date: Fri, 10 Jul 2015 17:00:49 +0200
-Subject: [PATCH 19/33] fixed correlation_id
-
----
- modules/sipcapture/hep.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/modules/sipcapture/hep.c b/modules/sipcapture/hep.c
-index c0a1791..2578d4f 100644
---- a/modules/sipcapture/hep.c
-+++ b/modules/sipcapture/hep.c
-@@ -274,6 +274,8 @@ int parsing_hepv3_message(char *buf, unsigned int len) {
-         src_ip.af = 0;
-                 	        
- 	payload = NULL;
-+	correlation_id = NULL;
-+	authkey = NULL;
- 
- 	i = sizeof(hep_ctrl_t);	        
- 	        
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0020-permissions-max-size-of-subnet-array-set-to-512.patch b/debian/patches/upstream/0020-permissions-max-size-of-subnet-array-set-to-512.patch
deleted file mode 100644
index 9668b49..0000000
--- a/debian/patches/upstream/0020-permissions-max-size-of-subnet-array-set-to-512.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From b8dbff13ed9426e909e54442d80621624a28e50f Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Mon, 28 Dec 2015 23:11:59 +0100
-Subject: [PATCH 20/33] permissions: max size of subnet array set to 512
-
-- was 128, which can be insufficient for large interconnect
-
-(cherry picked from commit 82d7e06b09f02a2e6dab9f171586f9cd6f636f5b)
----
- modules/permissions/hash.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/modules/permissions/hash.h b/modules/permissions/hash.h
-index 1ae0072..f4d101f 100644
---- a/modules/permissions/hash.h
-+++ b/modules/permissions/hash.h
-@@ -174,7 +174,7 @@ int addr_hash_table_rpc_print(struct addr_list** table, rpc_t* rpc, void* c);
- void empty_addr_hash_table(struct addr_list** hash_table);
- 
- 
--#define PERM_MAX_SUBNETS 128 
-+#define PERM_MAX_SUBNETS 512
- 
- 
- /*
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0021-tm-silent-mode-when-freeing-transactions-at-shutdown.patch b/debian/patches/upstream/0021-tm-silent-mode-when-freeing-transactions-at-shutdown.patch
deleted file mode 100644
index dbe5a1a..0000000
--- a/debian/patches/upstream/0021-tm-silent-mode-when-freeing-transactions-at-shutdown.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From beb0a65386d0d56e3d5c876b55cd08d3b54985df Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Tue, 29 Dec 2015 23:39:18 +0100
-Subject: [PATCH 21/33] tm: silent mode when freeing transactions at shutdown
-
-- they are still linked in tm hash table as it should be, so no warn
-  message for that case
-
-(cherry picked from commit 27495c7c34bf963e403c0f711daf9b76076d2ec3)
----
- modules/tm/h_table.c | 8 +++++---
- modules/tm/h_table.h | 5 +++--
- 2 files changed, 8 insertions(+), 5 deletions(-)
-
-diff --git a/modules/tm/h_table.c b/modules/tm/h_table.c
-index 5aee155..105230c 100644
---- a/modules/tm/h_table.c
-+++ b/modules/tm/h_table.c
-@@ -115,7 +115,7 @@ unsigned int transaction_count( void )
- 
- 
- 
--void free_cell_helper( struct cell* dead_cell, const char *fname, unsigned int fline )
-+void free_cell_helper(tm_cell_t* dead_cell, int silent, const char *fname, unsigned int fline )
- {
- 	char *b;
- 	int i;
-@@ -126,8 +126,10 @@ void free_cell_helper( struct cell* dead_cell, const char *fname, unsigned int f
- 	LM_DBG("freeing transaction %p from %s:%u\n", dead_cell, fname, fline);
- 
- 	if(dead_cell->prev_c!=NULL && dead_cell->next_c!=NULL) {
--		LM_WARN("removed cell %p is still linked in hash table (%s:%u)\n",
-+		if(likely(silent==0)) {
-+			LM_WARN("removed cell %p is still linked in hash table (%s:%u)\n",
- 				dead_cell, fname, fline);
-+		}
- 		unlink_timers(dead_cell);
- 		remove_from_hash_table_unsafe(dead_cell);
- 	}
-@@ -437,7 +439,7 @@ void free_hash_table(  )
- 			/* delete all synonyms at hash-collision-slot i */
- 			clist_foreach_safe(&_tm_table->entries[i], p_cell, tmp_cell,
- 									next_c){
--				free_cell(p_cell);
-+				free_cell_silent(p_cell);
- 			}
- 		}
- 		shm_free(_tm_table);
-diff --git a/modules/tm/h_table.h b/modules/tm/h_table.h
-index 7cda34e..0cbe24c 100644
---- a/modules/tm/h_table.h
-+++ b/modules/tm/h_table.h
-@@ -553,8 +553,9 @@ struct s_table* tm_get_table(void);
- struct s_table* init_hash_table(void);
- void   free_hash_table(void);
- 
--void   free_cell_helper( struct cell* dead_cell, const char *fname, unsigned int fline);
--#define free_cell(t) free_cell_helper((t), __FILE__, __LINE__)
-+void   free_cell_helper(tm_cell_t* dead_cell, int silent, const char *fname, unsigned int fline);
-+#define free_cell(t) free_cell_helper((t), 0, __FILE__, __LINE__)
-+#define free_cell_silent(t) free_cell_helper((t), 1, __FILE__, __LINE__)
- 
- struct cell*  build_cell( struct sip_msg* p_msg );
- 
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0022-tm-don-t-free-tm-cell-still-linked-in-wait-timer.patch b/debian/patches/upstream/0022-tm-don-t-free-tm-cell-still-linked-in-wait-timer.patch
deleted file mode 100644
index 23d9cdc..0000000
--- a/debian/patches/upstream/0022-tm-don-t-free-tm-cell-still-linked-in-wait-timer.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 384c0ce0728ce83023b50c0ea4748bfa6232a9b4 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Wed, 30 Dec 2015 00:29:49 +0100
-Subject: [PATCH 22/33] tm: don't free tm cell still linked in wait timer
-
-- wait timer should do the free
-- friendlier handling of situation when modules binding to tm do
-  inconsistent unref operations
-
-(cherry picked from commit d83a56bcdfeb8ffc75166a62e11ceb4c057c3ce5)
----
- modules/tm/h_table.c | 6 ++++++
- modules/tm/t_funcs.c | 6 ++++++
- modules/tm/t_funcs.h | 1 +
- 3 files changed, 13 insertions(+)
-
-diff --git a/modules/tm/h_table.c b/modules/tm/h_table.c
-index 105230c..ea38de0 100644
---- a/modules/tm/h_table.c
-+++ b/modules/tm/h_table.c
-@@ -40,6 +40,7 @@
- #include "t_reply.h"
- #include "t_cancel.h"
- #include "t_stats.h"
-+#include "t_funcs.h"
- #include "h_table.h"
- #include "../../fix_lumps.h" /* free_via_clen_lump */
- #include "timer.h"
-@@ -129,6 +130,11 @@ void free_cell_helper(tm_cell_t* dead_cell, int silent, const char *fname, unsig
- 		if(likely(silent==0)) {
- 			LM_WARN("removed cell %p is still linked in hash table (%s:%u)\n",
- 				dead_cell, fname, fline);
-+			if(t_on_wait(dead_cell)) {
-+				LM_WARN("cell %p is still linked in wait timer (%s:%u)"
-+						" - skip freeing now\n", dead_cell, fname, fline);
-+				return;
-+			}
- 		}
- 		unlink_timers(dead_cell);
- 		remove_from_hash_table_unsafe(dead_cell);
-diff --git a/modules/tm/t_funcs.c b/modules/tm/t_funcs.c
-index cec58e0..e498713 100644
---- a/modules/tm/t_funcs.c
-+++ b/modules/tm/t_funcs.c
-@@ -150,6 +150,12 @@ void put_on_wait(  struct cell  *Trans  )
- }
- 
- 
-+int t_on_wait(tm_cell_t *Trans)
-+{
-+	if(Trans->wait_timer.prev!=NULL || Trans->wait_timer.next!=NULL)
-+		return 1;
-+	return 0;
-+}
- 
- /* WARNING: doesn't work from failure route (deadlock, uses t_reply =>
-  *  tries to get the reply lock again) */
-diff --git a/modules/tm/t_funcs.h b/modules/tm/t_funcs.h
-index 173851b..b7b653e 100644
---- a/modules/tm/t_funcs.h
-+++ b/modules/tm/t_funcs.h
-@@ -190,6 +190,7 @@ int get_ip_and_port_from_uri( str* uri , unsigned int *param_ip,
- 
- 
- void put_on_wait(  struct cell  *Trans  );
-+int t_on_wait(tm_cell_t *Trans);
- 
- 
- int t_relay_to( struct sip_msg  *p_msg ,
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0023-tm-reinit-ref-counter-if-attempting-to-free-while-st.patch b/debian/patches/upstream/0023-tm-reinit-ref-counter-if-attempting-to-free-while-st.patch
deleted file mode 100644
index 98b4313..0000000
--- a/debian/patches/upstream/0023-tm-reinit-ref-counter-if-attempting-to-free-while-st.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 7fc18d15ce0cdcaf47127e5ef96a28a239ed4104 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Wed, 30 Dec 2015 21:18:23 +0100
-Subject: [PATCH 23/33] tm: reinit ref counter if attempting to free while
- still in wait timer
-
-(cherry picked from commit c7e411edb3c68260d43f86ee6977d468c074836b)
----
- modules/tm/h_table.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/modules/tm/h_table.c b/modules/tm/h_table.c
-index ea38de0..d492665 100644
---- a/modules/tm/h_table.c
-+++ b/modules/tm/h_table.c
-@@ -131,6 +131,7 @@ void free_cell_helper(tm_cell_t* dead_cell, int silent, const char *fname, unsig
- 			LM_WARN("removed cell %p is still linked in hash table (%s:%u)\n",
- 				dead_cell, fname, fline);
- 			if(t_on_wait(dead_cell)) {
-+				INIT_REF(dead_cell, 1);
- 				LM_WARN("cell %p is still linked in wait timer (%s:%u)"
- 						" - skip freeing now\n", dead_cell, fname, fline);
- 				return;
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0024-carrierroute-fixed-possible-kamctl-fifo-segfault.patch b/debian/patches/upstream/0024-carrierroute-fixed-possible-kamctl-fifo-segfault.patch
deleted file mode 100644
index d057c88..0000000
--- a/debian/patches/upstream/0024-carrierroute-fixed-possible-kamctl-fifo-segfault.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From df2dab4c7cc970cd449772e84ac1645070067336 Mon Sep 17 00:00:00 2001
-From: Lucian Balaceanu <lucian.balaceanu at 1and1.ro>
-Date: Tue, 19 Jan 2016 11:09:59 +0200
-Subject: [PATCH 24/33] carrierroute: fixed possible kamctl fifo segfault
-
-- introduced checks to reject contiguous -{OPTION}{PARAMETER} in kamctl fifo commands
-e.g.: kamctl fifo cr_activate_host "-dproxy -p 49 -h proxy1" is not allowed
----
- modules/carrierroute/cr_fifo.c | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/modules/carrierroute/cr_fifo.c b/modules/carrierroute/cr_fifo.c
-index 0455ba8..6cb6e55 100644
---- a/modules/carrierroute/cr_fifo.c
-+++ b/modules/carrierroute/cr_fifo.c
-@@ -490,7 +490,15 @@ static int get_fifo_opts(str * buf, fifo_opt_t * opts, unsigned int opt_set[]) {
- 		LM_DBG("token %.*s", opt_argv[i].len, opt_argv[i].s);
- 		if (opt_argv[i].len >= 1) {
- 			switch(*opt_argv[i].s) {
--					case '-': switch(opt_argv[i].s[1]) {
-+					case '-': 
-+						  /* -{OPTION}{PARAMETER} is not allowed */
-+                                                  if (opt_argv[i].len != 2) {
-+                                                        FIFO_ERR(E_WRONGOPT);
-+                                                        LM_DBG("Unknown option: %.*s\n", opt_argv[i].len, opt_argv[i].s);
-+                                                        return -1;
-+                                                  }
-+
-+						  switch(opt_argv[i].s[1]) {
- 							case OPT_DOMAIN_CHR:
- 							op = OPT_DOMAIN;
- 							used_opts |= O_DOMAIN;
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0025-topoh-proper-detection-of-cancel-reply-for-processin.patch b/debian/patches/upstream/0025-topoh-proper-detection-of-cancel-reply-for-processin.patch
deleted file mode 100644
index fde9acd..0000000
--- a/debian/patches/upstream/0025-topoh-proper-detection-of-cancel-reply-for-processin.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 3ed6eecd71b3178f6dc7e777ee6fccb1314ef352 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Wed, 20 Jan 2016 18:30:30 +0100
-Subject: [PATCH 25/33] topoh: proper detection of cancel reply for processing
-
-- reported by Alex Balashov
-
-(cherry picked from commit 0ce66908ee9da74806e2fa506ef98b5f9043e47c)
----
- modules/topoh/topoh_mod.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/modules/topoh/topoh_mod.c b/modules/topoh/topoh_mod.c
-index d3f347e..f6e576c 100644
---- a/modules/topoh/topoh_mod.c
-+++ b/modules/topoh/topoh_mod.c
-@@ -330,7 +330,7 @@ int th_msg_received(void *data)
- 		{
- 			/* one Via in received reply -- it is for local generated request
- 			 * - nothing to unhide unless is CANCEL/ACK */
--			if((get_cseq(&msg)->method_id)&(METHOD_CANCEL))
-+			if(!((get_cseq(&msg)->method_id)&(METHOD_CANCEL)))
- 				goto done;
- 		}
- 
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0026-dtrie-sanity-checks.patch b/debian/patches/upstream/0026-dtrie-sanity-checks.patch
deleted file mode 100644
index 300fd50..0000000
--- a/debian/patches/upstream/0026-dtrie-sanity-checks.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 83e842d64ee7c0726059d92fc78bdbfa10b2d117 Mon Sep 17 00:00:00 2001
-From: Stefan Mititelu <stefan.mititelu at 1and1.ro>
-Date: Fri, 22 Jan 2016 14:11:25 +0200
-Subject: [PATCH 26/33] dtrie: sanity checks
-
-Segfaults reported by Igor, on sr-Users mailing list.
-
-(cherry picked from commit 825b4fabb9bb4b2cf58dc1205423b8ce5d5e08cc)
----
- lib/trie/dtrie.c | 14 +++++++++++++-
- 1 file changed, 13 insertions(+), 1 deletion(-)
-
-diff --git a/lib/trie/dtrie.c b/lib/trie/dtrie.c
-index 2883829..f0b2655 100644
---- a/lib/trie/dtrie.c
-+++ b/lib/trie/dtrie.c
-@@ -76,7 +76,9 @@ void dtrie_delete(struct dtrie_node_t *root, struct dtrie_node_t *node,
- 		dt_delete_func_t delete_payload, const unsigned int branches)
- {
- 	unsigned int i;
--	if (node==NULL) return;
-+
-+	if (node == NULL) return;
-+	if (root == NULL) return;
- 
- 	for (i=0; i<branches; i++) {
- 		dtrie_delete(root, node->child[i], delete_payload, branches);
-@@ -123,6 +125,10 @@ int dtrie_insert(struct dtrie_node_t *root, const char *number, const unsigned i
- 	struct dtrie_node_t *node = root;
- 	unsigned char digit, i=0;
- 
-+	if (node == NULL) return -1;
-+	if (root == NULL) return -1;
-+	if (number == NULL) return -1;
-+
- 	while (i<numberlen) {
- 		if (branches==10) {
- 			digit = number[i] - '0';
-@@ -202,6 +208,8 @@ unsigned int dtrie_leaves(const struct dtrie_node_t *root, const unsigned int br
- {
- 	unsigned int i, sum = 0, leaf = 1;
- 
-+	if (root == NULL) return 0;
-+
- 	for (i=0; i<branches; i++) {
- 		if (root->child[i]) {
- 			sum += dtrie_leaves(root->child[i], branches);
-@@ -220,6 +228,10 @@ void **dtrie_longest_match(struct dtrie_node_t *root, const char *number,
- 	unsigned char digit, i = 0;
- 	void **ret = NULL;
- 
-+	if (node == NULL) return NULL;
-+	if (root == NULL) return NULL;
-+	if (number == NULL) return NULL;
-+
- 	if (nmatchptr) *nmatchptr=-1;
- 	if (node->data != NULL) {
- 		if (nmatchptr) *nmatchptr=0;
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0027-corex-fix-regression-introduced-with-detection-of-ip.patch b/debian/patches/upstream/0027-corex-fix-regression-introduced-with-detection-of-ip.patch
deleted file mode 100644
index 52651f5..0000000
--- a/debian/patches/upstream/0027-corex-fix-regression-introduced-with-detection-of-ip.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 160ec06e7d7e3f8c46fdc62132c46fd695119572 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Fri, 5 Feb 2016 09:18:48 +0100
-Subject: [PATCH 27/33] corex: fix regression introduced with detection of ipv6
- for send()
-
-- reported by Paul Arnold, GH #496
-
-(cherry picked from commit 8e20a3c5cf3036b203cda629d89659fb1c57c53b)
----
- modules/corex/corex_lib.c | 11 +++++++----
- 1 file changed, 7 insertions(+), 4 deletions(-)
-
-diff --git a/modules/corex/corex_lib.c b/modules/corex/corex_lib.c
-index 21593f5..9e1c521 100644
---- a/modules/corex/corex_lib.c
-+++ b/modules/corex/corex_lib.c
-@@ -258,11 +258,14 @@ int corex_send(sip_msg_t *msg, gparam_t *pu, enum sip_protos proto)
- 		u = &next_hop;
- 		u->port_no = 5060;
- 		u->host = dest;
--		p = dest.s;
- 		/* detect ipv6 */
--		p = memchr(p, ']', dest.len);
--		if (p) p++;
--		p = memchr(p, ':', dest.len);
-+		p = memchr(dest.s, ']', dest.len);
-+		if (p) {
-+			p++;
-+			p = memchr(p, ':', dest.s + dest.len - p);
-+		} else {
-+			p = memchr(dest.s, ':', dest.len);
-+		}
- 		if (p)
- 		{
- 			u->host.len = p - dest.s;
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0028-presence_mwi-static-declaration-for-inline-function-.patch b/debian/patches/upstream/0028-presence_mwi-static-declaration-for-inline-function-.patch
deleted file mode 100644
index 856ca2d..0000000
--- a/debian/patches/upstream/0028-presence_mwi-static-declaration-for-inline-function-.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 463f2817e8685d6d1fbc3b4d6486d0aa05e3a48f Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Sun, 7 Feb 2016 19:55:25 +0100
-Subject: [PATCH 28/33] presence_mwi: static declaration for inline function
- for eating spaces
-
-- based on a report by Anthony Messina, GH #502
-- get rid of undefined symbols for some compilers
-
-(cherry picked from commit 619988ad6cf54d7e8154a9efb65ce2b9cb475e54)
----
- modules/presence_mwi/add_events.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/modules/presence_mwi/add_events.c b/modules/presence_mwi/add_events.c
-index c2dda4e..8f58508 100644
---- a/modules/presence_mwi/add_events.c
-+++ b/modules/presence_mwi/add_events.c
-@@ -40,14 +40,14 @@
- #include "presence_mwi.h"
- 
- /*! \brief utility function that skips spaces and tabs */
--inline char *eat_sp_tab(char *at, char *over)
-+static inline char *eat_sp_tab(char *at, char *over)
- {
-     while((at < over) && ((*at == ' ') || (*at == '\t'))) at++;
-     return at;
- }
- 
- /*! \brief utility function that skips printable ascii chars */
--inline char *eat_printable(char *at, char *over)
-+static inline char *eat_printable(char *at, char *over)
- {
-     while ((at < over) && ((*at == '\t') || ((*at >= 32) && (*at <= 126))))
- 	at++;
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0029-auth_db-removed-trailing-spaces-for-sane-git-diff.patch b/debian/patches/upstream/0029-auth_db-removed-trailing-spaces-for-sane-git-diff.patch
deleted file mode 100644
index f31672f..0000000
--- a/debian/patches/upstream/0029-auth_db-removed-trailing-spaces-for-sane-git-diff.patch
+++ /dev/null
@@ -1,117 +0,0 @@
-From 9e62c2ff843f44c18c418f01285f60c8b5de86d0 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Sun, 7 Feb 2016 19:54:47 +0100
-Subject: [PATCH 29/33] auth_db: removed trailing spaces for sane git diff
-
-(cherry picked from commit 35fa264fe9a70627e9f17f75e0ce39ddbd3550ba)
----
- modules/auth_db/auth_db_mod.c | 16 ++++++++--------
- modules/auth_db/authorize.c   | 10 +++++-----
- 2 files changed, 13 insertions(+), 13 deletions(-)
-
-diff --git a/modules/auth_db/auth_db_mod.c b/modules/auth_db/auth_db_mod.c
-index abd9c29..3f22f4f 100644
---- a/modules/auth_db/auth_db_mod.c
-+++ b/modules/auth_db/auth_db_mod.c
-@@ -1,4 +1,4 @@
--/* 
-+/*
-  * Digest Authentication Module
-  *
-  * Copyright (C) 2001-2003 FhG Fokus
-@@ -15,8 +15,8 @@
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  * GNU General Public License for more details.
-  *
-- * You should have received a copy of the GNU General Public License 
-- * along with this program; if not, write to the Free Software 
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-  *
-  */
-@@ -134,7 +134,7 @@ static param_export_t params[] = {
-  * Module interface
-  */
- struct module_exports exports = {
--	"auth_db", 
-+	"auth_db",
- 	DEFAULT_DLFLAGS, /* dlopen flags */
- 	cmds,       /* Exported functions */
- 	params,     /* Exported parameters */
-@@ -153,7 +153,7 @@ static int child_init(int rank)
- {
- 	if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
- 		return 0; /* do nothing for the main process */
--	
-+
- 	auth_db_handle = auth_dbf.init(&db_url);
- 	if (auth_db_handle == 0){
- 		LM_ERR("unable to connect to the database\n");
-@@ -220,7 +220,7 @@ static int w_is_subscriber(sip_msg_t *msg, char *_uri, char* _table,
- {
- 	str suri;
- 	str stable;
--	int iflags;
-+	int iflags = 0;
- 	int ret;
- 	sip_uri_t puri;
- 
-@@ -356,7 +356,7 @@ int parse_aaa_pvs(char *definition, pv_elem_t **pv_def, int *cnt)
- 
- 		/* definition is between p and e */
- 		/* search backwards because PV definition may contain '=' characters */
--		for (sep = end; sep >= p && *sep != '='; sep--); 
-+		for (sep = end; sep >= p && *sep != '='; sep--);
- 		if (sep > p) {
- 			/* pv=column style */
- 			/* set column name */
-@@ -385,7 +385,7 @@ int parse_aaa_pvs(char *definition, pv_elem_t **pv_def, int *cnt)
- 				goto parse_error;
- 			}
- 			pv.len = snprintf(pv.s, pve->text.len + 7, "$avp(%.*s)",
--			                  pve->text.len, pve->text.s);
-+					pve->text.len, pve->text.s);
- 		}
- 
- 		/* create a pv spec */
-diff --git a/modules/auth_db/authorize.c b/modules/auth_db/authorize.c
-index 86e1cb7..c307326 100644
---- a/modules/auth_db/authorize.c
-+++ b/modules/auth_db/authorize.c
-@@ -15,8 +15,8 @@
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  * GNU General Public License for more details.
-  *
-- * You should have received a copy of the GNU General Public License 
-- * along with this program; if not, write to the Free Software 
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-  *
-  */
-@@ -126,7 +126,7 @@ done:
- }
- 
- static inline int get_ha1(struct username* _username, str* _domain,
--			  const str* _table, char* _ha1, db1_res_t** res)
-+		const str* _table, char* _ha1, db1_res_t** res)
- {
- 	pv_elem_t *cred;
- 	db_key_t keys[2];
-@@ -496,10 +496,10 @@ int auth_check(struct sip_msg* _m, char* _realm, char* _table, char *_flags)
- 
- 	if(ret==AUTH_OK && hdr!=NULL && (iflags&AUTH_CHECK_ID_F)) {
- 		srealm = ((auth_body_t*)(hdr->parsed))->digest.username.user;
--			
-+
- 		if((furi=parse_from_uri(_m))==NULL)
- 			return AUTH_ERROR;
--		
-+
- 		if(_m->REQ_METHOD==METHOD_REGISTER || _m->REQ_METHOD==METHOD_PUBLISH) {
- 			if((turi=parse_to_uri(_m))==NULL)
- 				return AUTH_ERROR;
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0030-auth_db-use-username-when-querying-for-credentials-v.patch b/debian/patches/upstream/0030-auth_db-use-username-when-querying-for-credentials-v.patch
deleted file mode 100644
index df5e396..0000000
--- a/debian/patches/upstream/0030-auth_db-use-username-when-querying-for-credentials-v.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 4602f2dc430b97b6e76ae5da9ebf7f2a7984a48c Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Sun, 7 Feb 2016 20:21:27 +0100
-Subject: [PATCH 30/33] auth_db: use username when querying for credentials via
- is_subscriber
-
-- for the case when credentials should not be stored, just discover if a
-  record exists for the user
-- avoids buffer overflow by setting all credentials columns, while
-  trying to use only the first column
-- reported by Anthony Messina, GH #500
-
-(cherry picked from commit adbbe8b62d6b4b95e5ecbab041b93bb3130f1932)
----
- modules/auth_db/authorize.c | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/modules/auth_db/authorize.c b/modules/auth_db/authorize.c
-index c307326..9174894 100644
---- a/modules/auth_db/authorize.c
-+++ b/modules/auth_db/authorize.c
-@@ -62,13 +62,16 @@ int fetch_credentials(sip_msg_t *msg, str *user, str* domain, str *table, int fl
- 		LM_ERR("no more pkg memory\n");
- 		return -1;
- 	}
--	col[0] = &user_column;
- 
- 	keys[0] = &user_column;
- 	keys[1] = &domain_column;
- 
--	for (n = 0, cred=credentials; cred ; n++, cred=cred->next) {
--		col[n] = &cred->text;
-+	if(flags&AUTH_DB_SUBS_SKIP_CREDENTIALS) {
-+		col[0] = &user_column;
-+	} else {
-+		for (n = 0, cred=credentials; cred ; n++, cred=cred->next) {
-+			col[n] = &cred->text;
-+		}
- 	}
- 
- 	VAL_TYPE(vals) = VAL_TYPE(vals + 1) = DB1_STR;
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0031-seas-safety-check-for-target-buffer-size-before-copy.patch b/debian/patches/upstream/0031-seas-safety-check-for-target-buffer-size-before-copy.patch
deleted file mode 100644
index 4e2fd04..0000000
--- a/debian/patches/upstream/0031-seas-safety-check-for-target-buffer-size-before-copy.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 18cd34781d2bdda9c19314c0494f6a655dbe6089 Mon Sep 17 00:00:00 2001
-From: Daniel-Constantin Mierla <miconda at gmail.com>
-Date: Fri, 12 Feb 2016 18:04:19 +0100
-Subject: [PATCH 31/33] seas: safety check for target buffer size before
- copying message in encode_msg()
-
-- avoid buffer overflow for large SIP messages
-- reported by Stelios Tsampas
-
-(cherry picked from commit f50c9c853e7809810099c970780c30b0765b0643)
----
- modules/seas/encode_msg.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/modules/seas/encode_msg.c b/modules/seas/encode_msg.c
-index 06d31a3..e56b5fb 100644
---- a/modules/seas/encode_msg.c
-+++ b/modules/seas/encode_msg.c
-@@ -158,6 +158,7 @@ int encode_msg(struct sip_msg *msg,char *payload,int len)
- 
-    if(len < MAX_ENCODED_MSG + MAX_MESSAGE_LEN)
-       return -1;
-+
-    if(parse_headers(msg,HDR_EOH_F,0)<0){
-       myerror="in parse_headers";
-       goto error;
-@@ -266,6 +267,11 @@ int encode_msg(struct sip_msg *msg,char *payload,int len)
-    /*j+=k;*/
-    /*pkg_free(payload2);*/
-    /*now we copy the actual message after the headers-meta-section*/
-+
-+	if(len < j + msg->len + 1) {
-+   	   LM_ERR("not enough space to encode sip message\n");
-+   	   return -1;
-+	}
-    memcpy(&payload[j],msg->buf,msg->len);
-    LM_DBG("msglen = %d,msg starts at %d\n",msg->len,j);
-    j=htons(j);
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0032-pv-Fix-crash-when-xavp-has-no-attributes.patch b/debian/patches/upstream/0032-pv-Fix-crash-when-xavp-has-no-attributes.patch
deleted file mode 100644
index 750bce1..0000000
--- a/debian/patches/upstream/0032-pv-Fix-crash-when-xavp-has-no-attributes.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From a84d800c491c7d05e7abec1f8fe169c6c52e8e62 Mon Sep 17 00:00:00 2001
-From: Hugh Waite <hugh.waite at xura.com>
-Date: Tue, 16 Feb 2016 17:23:50 +0000
-Subject: [PATCH 32/33] pv: Fix crash when xavp has no attributes - Fixes the
- crash reported in #511 (cherry picked from commit
- 19bb634ba043e74480c724fb7ed8a2dad43e8dda)
-
----
- modules/pv/pv_xavp.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/modules/pv/pv_xavp.c b/modules/pv/pv_xavp.c
-index 53fd99a..3ef86fb 100644
---- a/modules/pv/pv_xavp.c
-+++ b/modules/pv/pv_xavp.c
-@@ -111,6 +111,8 @@ int pv_get_xavp(struct sip_msg *msg, pv_param_t *param,
- 		return pv_get_null(msg, param, res);
- 	if(xname->next==NULL)
- 		return pv_xavp_get_value(msg, param, res, avp);
-+	if(avp->val.type != SR_XTYPE_XAVP)
-+		return pv_get_null(msg, param, res);
- 
- 	idx = 0;
- 	idxf = 0;
--- 
-2.7.0
-
diff --git a/debian/patches/upstream/0033-srutils-change-names-colliding-with-libcrypto.patch b/debian/patches/upstream/0033-srutils-change-names-colliding-with-libcrypto.patch
deleted file mode 100644
index 8e3f625..0000000
--- a/debian/patches/upstream/0033-srutils-change-names-colliding-with-libcrypto.patch
+++ /dev/null
@@ -1,352 +0,0 @@
-From 9165e8522ea03dda4968e1853216eb508ffd7a1f Mon Sep 17 00:00:00 2001
-From: Camille Oudot <camille.oudot at orange.com>
-Date: Thu, 18 Feb 2016 11:09:24 +0100
-Subject: [PATCH 33/33] srutils: change names colliding with libcrypto
-
-(cherry picked from commit 4b5da2d909ea3fcd531eecff2f3e02adad26fa27)
----
- lib/srutils/sha256.c   | 56 ++++++++++++++---------------
- lib/srutils/sha256.h   | 98 +++++++++++++++++++++++++-------------------------
- lib/srutils/shautils.c | 18 +++++-----
- 3 files changed, 86 insertions(+), 86 deletions(-)
-
-diff --git a/lib/srutils/sha256.c b/lib/srutils/sha256.c
-index 5e87beb..90efd15 100644
---- a/lib/srutils/sha256.c
-+++ b/lib/srutils/sha256.c
-@@ -339,7 +339,7 @@ static const char *sha2_hex_digits = "0123456789abcdef";
- 
- 
- /*** SHA-256: *********************************************************/
--void SHA256_Init(SHA256_CTX* context) {
-+void sr_SHA256_Init(SHA256_CTX* context) {
- 	if (context == (SHA256_CTX*)0) {
- 		return;
- 	}
-@@ -523,7 +523,7 @@ void SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) {
- 
- #endif /* SHA2_UNROLL_TRANSFORM */
- 
--void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
-+void sr_SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
- 	unsigned int	freespace, usedspace;
- 
- 	if (len == 0) {
-@@ -571,7 +571,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) {
- 	usedspace = freespace = 0;
- }
- 
--void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
-+void sr_SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
- 	sha2_word32	*d = (sha2_word32*)digest;
- 	unsigned int	usedspace;
- 
-@@ -634,7 +634,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
- 	usedspace = 0;
- }
- 
--char *SHA256_End(SHA256_CTX* context, char buffer[]) {
-+char *sr_SHA256_End(SHA256_CTX* context, char buffer[]) {
- 	sha2_byte	digest[SHA256_DIGEST_LENGTH], *d = digest;
- 	int		i;
- 
-@@ -642,7 +642,7 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) {
- 	assert(context != (SHA256_CTX*)0);
- 
- 	if (buffer != (char*)0) {
--		SHA256_Final(digest, context);
-+		sr_SHA256_Final(digest, context);
- 
- 		for (i = 0; i < SHA256_DIGEST_LENGTH; i++) {
- 			*buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
-@@ -657,17 +657,17 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) {
- 	return buffer;
- }
- 
--char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) {
-+char* sr_SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) {
- 	SHA256_CTX	context;
- 
--	SHA256_Init(&context);
--	SHA256_Update(&context, data, len);
--	return SHA256_End(&context, digest);
-+	sr_SHA256_Init(&context);
-+	sr_SHA256_Update(&context, data, len);
-+	return sr_SHA256_End(&context, digest);
- }
- 
- 
- /*** SHA-512: *********************************************************/
--void SHA512_Init(SHA512_CTX* context) {
-+void sr_SHA512_Init(SHA512_CTX* context) {
- 	if (context == (SHA512_CTX*)0) {
- 		return;
- 	}
-@@ -845,7 +845,7 @@ void SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) {
- 
- #endif /* SHA2_UNROLL_TRANSFORM */
- 
--void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) {
-+void sr_SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) {
- 	unsigned int	freespace, usedspace;
- 
- 	if (len == 0) {
-@@ -934,7 +934,7 @@ void SHA512_Last(SHA512_CTX* context) {
- 	SHA512_Transform(context, (sha2_word64*)context->buffer);
- }
- 
--void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
-+void sr_SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
- 	sha2_word64	*d = (sha2_word64*)digest;
- 
- 	/* Sanity check: */
-@@ -963,7 +963,7 @@ void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
- 	MEMSET_BZERO(context, sizeof(*context));
- }
- 
--char *SHA512_End(SHA512_CTX* context, char buffer[]) {
-+char *sr_SHA512_End(SHA512_CTX* context, char buffer[]) {
- 	sha2_byte	digest[SHA512_DIGEST_LENGTH], *d = digest;
- 	int		i;
- 
-@@ -971,7 +971,7 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) {
- 	assert(context != (SHA512_CTX*)0);
- 
- 	if (buffer != (char*)0) {
--		SHA512_Final(digest, context);
-+		sr_SHA512_Final(digest, context);
- 
- 		for (i = 0; i < SHA512_DIGEST_LENGTH; i++) {
- 			*buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
-@@ -986,17 +986,17 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) {
- 	return buffer;
- }
- 
--char* SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) {
-+char* sr_SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) {
- 	SHA512_CTX	context;
- 
--	SHA512_Init(&context);
--	SHA512_Update(&context, data, len);
--	return SHA512_End(&context, digest);
-+	sr_SHA512_Init(&context);
-+	sr_SHA512_Update(&context, data, len);
-+	return sr_SHA512_End(&context, digest);
- }
- 
- 
- /*** SHA-384: *********************************************************/
--void SHA384_Init(SHA384_CTX* context) {
-+void sr_SHA384_Init(SHA384_CTX* context) {
- 	if (context == (SHA384_CTX*)0) {
- 		return;
- 	}
-@@ -1005,11 +1005,11 @@ void SHA384_Init(SHA384_CTX* context) {
- 	context->bitcount[0] = context->bitcount[1] = 0;
- }
- 
--void SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) {
--	SHA512_Update((SHA512_CTX*)context, data, len);
-+void sr_SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) {
-+	sr_SHA512_Update((SHA512_CTX*)context, data, len);
- }
- 
--void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
-+void sr_SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
- 	sha2_word64	*d = (sha2_word64*)digest;
- 
- 	/* Sanity check: */
-@@ -1038,7 +1038,7 @@ void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
- 	MEMSET_BZERO(context, sizeof(*context));
- }
- 
--char *SHA384_End(SHA384_CTX* context, char buffer[]) {
-+char *sr_SHA384_End(SHA384_CTX* context, char buffer[]) {
- 	sha2_byte	digest[SHA384_DIGEST_LENGTH], *d = digest;
- 	int		i;
- 
-@@ -1046,7 +1046,7 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) {
- 	assert(context != (SHA384_CTX*)0);
- 
- 	if (buffer != (char*)0) {
--		SHA384_Final(digest, context);
-+		sr_SHA384_Final(digest, context);
- 
- 		for (i = 0; i < SHA384_DIGEST_LENGTH; i++) {
- 			*buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4];
-@@ -1061,10 +1061,10 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) {
- 	return buffer;
- }
- 
--char* SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) {
-+char* sr_SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) {
- 	SHA384_CTX	context;
- 
--	SHA384_Init(&context);
--	SHA384_Update(&context, data, len);
--	return SHA384_End(&context, digest);
-+	sr_SHA384_Init(&context);
-+	sr_SHA384_Update(&context, data, len);
-+	return sr_SHA384_End(&context, digest);
- }
-diff --git a/lib/srutils/sha256.h b/lib/srutils/sha256.h
-index 4c134d2..111c8be 100644
---- a/lib/srutils/sha256.h
-+++ b/lib/srutils/sha256.h
-@@ -133,65 +133,65 @@ typedef SHA512_CTX SHA384_CTX;
- #ifndef NOPROTO
- #ifdef SHA2_USE_INTTYPES_H
- 
--void SHA256_Init(SHA256_CTX *);
--void SHA256_Update(SHA256_CTX*, const uint8_t*, size_t);
--void SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*);
--char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]);
--char* SHA256_Data(const uint8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]);
--
--void SHA384_Init(SHA384_CTX*);
--void SHA384_Update(SHA384_CTX*, const uint8_t*, size_t);
--void SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*);
--char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]);
--char* SHA384_Data(const uint8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]);
--
--void SHA512_Init(SHA512_CTX*);
--void SHA512_Update(SHA512_CTX*, const uint8_t*, size_t);
--void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
--char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]);
--char* SHA512_Data(const uint8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
-+void sr_SHA256_Init(SHA256_CTX *);
-+void sr_SHA256_Update(SHA256_CTX*, const uint8_t*, size_t);
-+void sr_SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*);
-+char* sr_SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]);
-+char* sr_SHA256_Data(const uint8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]);
-+
-+void sr_SHA384_Init(SHA384_CTX*);
-+void sr_SHA384_Update(SHA384_CTX*, const uint8_t*, size_t);
-+void sr_SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*);
-+char* sr_SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]);
-+char* sr_SHA384_Data(const uint8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]);
-+
-+void sr_SHA512_Init(SHA512_CTX*);
-+void sr_SHA512_Update(SHA512_CTX*, const uint8_t*, size_t);
-+void sr_SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
-+char* sr_SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]);
-+char* sr_SHA512_Data(const uint8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
- 
- #else /* SHA2_USE_INTTYPES_H */
- 
--void SHA256_Init(SHA256_CTX *);
--void SHA256_Update(SHA256_CTX*, const u_int8_t*, size_t);
--void SHA256_Final(u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*);
--char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]);
--char* SHA256_Data(const u_int8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]);
-+void sr_SHA256_Init(SHA256_CTX *);
-+void sr_SHA256_Update(SHA256_CTX*, const u_int8_t*, size_t);
-+void sr_SHA256_Final(u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*);
-+char* sr_SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]);
-+char* sr_SHA256_Data(const u_int8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]);
- 
--void SHA384_Init(SHA384_CTX*);
--void SHA384_Update(SHA384_CTX*, const u_int8_t*, size_t);
--void SHA384_Final(u_int8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*);
--char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]);
--char* SHA384_Data(const u_int8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]);
-+void sr_SHA384_Init(SHA384_CTX*);
-+void sr_SHA384_Update(SHA384_CTX*, const u_int8_t*, size_t);
-+void sr_SHA384_Final(u_int8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*);
-+char* sr_SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]);
-+char* sr_SHA384_Data(const u_int8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]);
- 
--void SHA512_Init(SHA512_CTX*);
--void SHA512_Update(SHA512_CTX*, const u_int8_t*, size_t);
--void SHA512_Final(u_int8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
--char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]);
--char* SHA512_Data(const u_int8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
-+void sr_SHA512_Init(SHA512_CTX*);
-+void sr_SHA512_Update(SHA512_CTX*, const u_int8_t*, size_t);
-+void sr_SHA512_Final(u_int8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
-+char* sr_SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]);
-+char* sr_SHA512_Data(const u_int8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
- 
- #endif /* SHA2_USE_INTTYPES_H */
- 
- #else /* NOPROTO */
- 
--void SHA256_Init();
--void SHA256_Update();
--void SHA256_Final();
--char* SHA256_End();
--char* SHA256_Data();
--
--void SHA384_Init();
--void SHA384_Update();
--void SHA384_Final();
--char* SHA384_End();
--char* SHA384_Data();
--
--void SHA512_Init();
--void SHA512_Update();
--void SHA512_Final();
--char* SHA512_End();
--char* SHA512_Data();
-+void sr_SHA256_Init();
-+void sr_SHA256_Update();
-+void sr_SHA256_Final();
-+char* sr_SHA256_End();
-+char* sr_SHA256_Data();
-+
-+void sr_SHA384_Init();
-+void sr_SHA384_Update();
-+void sr_SHA384_Final();
-+char* sr_SHA384_End();
-+char* sr_SHA384_Data();
-+
-+void sr_SHA512_Init();
-+void sr_SHA512_Update();
-+void sr_SHA512_Final();
-+char* sr_SHA512_End();
-+char* sr_SHA512_Data();
- 
- #endif /* NOPROTO */
- 
-diff --git a/lib/srutils/shautils.c b/lib/srutils/shautils.c
-index 21cb6cc..f578fdb 100644
---- a/lib/srutils/shautils.c
-+++ b/lib/srutils/shautils.c
-@@ -49,25 +49,25 @@ void compute_md5(char *dst, char *src, int src_len)
- void compute_sha256(char *dst, u_int8_t *src, int src_len)
- {
- 	SHA256_CTX ctx256;
--	SHA256_Init(&ctx256);
--	SHA256_Update(&ctx256, src, src_len);
--	SHA256_End(&ctx256, dst);
-+	sr_SHA256_Init(&ctx256);
-+	sr_SHA256_Update(&ctx256, src, src_len);
-+	sr_SHA256_End(&ctx256, dst);
- }
- 
- /*! \brief Compute SHA384 checksum */
- void compute_sha384(char *dst, u_int8_t *src, int src_len)
- {
- 	SHA384_CTX ctx384;
--	SHA384_Init(&ctx384);
--	SHA384_Update(&ctx384, src, src_len);
--	SHA384_End(&ctx384, dst);
-+	sr_SHA384_Init(&ctx384);
-+	sr_SHA384_Update(&ctx384, src, src_len);
-+	sr_SHA384_End(&ctx384, dst);
- }
- 
- /*! \brief Compute SHA512 checksum */
- void compute_sha512(char *dst, u_int8_t *src, int src_len)
- {
- 	SHA512_CTX ctx512;
--	SHA512_Init(&ctx512);
--	SHA512_Update(&ctx512, src, src_len);
--	SHA512_End(&ctx512, dst);
-+	sr_SHA512_Init(&ctx512);
-+	sr_SHA512_Update(&ctx512, src, src_len);
-+	sr_SHA512_End(&ctx512, dst);
- }
--- 
-2.7.0
-

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/kamailio.git



More information about the Pkg-voip-commits mailing list