From 81c827376fa155d9d2dcb548f428e690f63d7c6e Mon Sep 17 00:00:00 2001 From: Peter Lemenkov Date: Jun 13 2019 11:49:28 +0000 Subject: OpenSIPS ver. 2.4.6 Signed-off-by: Peter Lemenkov --- diff --git a/opensips-0001-Consistently-use-rtpproxy-switches.patch b/opensips-0001-Consistently-use-rtpproxy-switches.patch index a324d28..a03106c 100644 --- a/opensips-0001-Consistently-use-rtpproxy-switches.patch +++ b/opensips-0001-Consistently-use-rtpproxy-switches.patch @@ -18,10 +18,10 @@ index b12e81afa..e08fa0bee 100644 diff --git a/modules/rtpproxy/rtpproxy.c b/modules/rtpproxy/rtpproxy.c -index 4d28c4d63..b7269564b 100644 +index 36e40f9aa..14130c624 100644 --- a/modules/rtpproxy/rtpproxy.c +++ b/modules/rtpproxy/rtpproxy.c -@@ -3554,8 +3554,6 @@ int force_rtp_proxy_body(struct sip_msg* msg, struct force_rtpp_args *args, +@@ -3566,8 +3566,6 @@ int force_rtp_proxy_body(struct sip_msg* msg, struct force_rtpp_args *args, enable_notification = 1; break; diff --git a/opensips-0003-Removed-all-async-Oracle-operations-they-didn-t-work.patch b/opensips-0003-Removed-all-async-Oracle-operations-they-didn-t-work.patch deleted file mode 100644 index 2207fbd..0000000 --- a/opensips-0003-Removed-all-async-Oracle-operations-they-didn-t-work.patch +++ /dev/null @@ -1,588 +0,0 @@ -From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=A1=D0=B0=D0=BC?= - =?UTF-8?q?=D1=83=D1=81=D0=B5=D0=BD=D0=BA=D0=BE?= -Date: Mon, 25 Jun 2012 17:54:27 +0400 -Subject: [PATCH] Removed all async Oracle operations - they didn't work well - anyway - - -diff --git a/modules/db_oracle/db_oracle.c b/modules/db_oracle/db_oracle.c -index 82ef0761c..02a705403 100644 ---- a/modules/db_oracle/db_oracle.c -+++ b/modules/db_oracle/db_oracle.c -@@ -29,7 +29,7 @@ - #include "../../sr_module.h" - #include "../../db/db.h" - #include "dbase.h" --#include "asynch.h" -+#include "timer.h" - - static int oracle_mod_init(void); - static void destroy(void); -diff --git a/modules/db_oracle/dbase.c b/modules/db_oracle/dbase.c -index c859cbe68..3a4d6109f 100644 ---- a/modules/db_oracle/dbase.c -+++ b/modules/db_oracle/dbase.c -@@ -34,7 +34,7 @@ - #include "val.h" - #include "ora_con.h" - #include "res.h" --#include "asynch.h" -+#include "timer.h" - #include "dbase.h" - - -@@ -210,7 +210,6 @@ static int db_oracle_submit_query(const db_con_t* _h, const str* _s) - OCIDate odt[sizeof(bind)/sizeof(bind[0])]; - str tmps; - sword status; -- int pass; - ora_con_t* con = CON_ORA(_h); - query_data_t* pqd = con->pqdata; - size_t hc = pqd->_n + pqd->_nw; -@@ -222,31 +221,15 @@ static int db_oracle_submit_query(const db_con_t* _h, const str* _s) - return -1; - } - -- if (!pqd->_rs) { -- /* -- * This method is at ~25% faster as set OCI_COMMIT_ON_SUCCESS -- * in StmtExecute -- */ -- tmps.len = snprintf(st_buf, sizeof(st_buf), -- "begin %.*s; commit write batch nowait; end;", -- _s->len, _s->s); -- if ((unsigned)tmps.len >= sizeof(st_buf)) -- return sql_buf_small(); -- tmps.s = st_buf; -- _s = &tmps; -- } -- -- pass = 1; -- if (!con->connected) { -+ if (con->connected != 2) { - status = db_oracle_reconnect(con); - if (status != OCI_SUCCESS) { - LM_ERR("can't restore connection: %s\n", db_oracle_error(con, status)); - return -2; - } - LM_INFO("connection restored\n"); -- --pass; - } --repeat: -+ - stmthp = NULL; - status = OCIHandleAlloc(con->envhp, (dvoid**)(dvoid*)&stmthp, - OCI_HTYPE_STMT, 0, NULL); -@@ -289,14 +272,10 @@ bind_err: - } - } - -- // timelimited operation -- status = begin_timelimit(con, 0); -- if (status != OCI_SUCCESS) goto ora_err; -- do status = OCIStmtExecute(con->svchp, stmthp, con->errhp, -- !pqd->_rs, 0, NULL, NULL, -- pqd->_rs ? OCI_STMT_SCROLLABLE_READONLY : OCI_DEFAULT); -- while (wait_timelimit(con, status)); -- if (done_timelimit(con, status)) goto stop_exec; -+ request_timer(); -+ status = OCIStmtExecute(con->svchp, stmthp, con->errhp, -+ !pqd->_rs, 0, NULL, NULL, pqd->_rs ? OCI_DEFAULT : OCI_COMMIT_ON_SUCCESS); -+ timer_stop(); - switch (status) { - case OCI_SUCCESS_WITH_INFO: - LM_WARN("driver: %s\n", db_oracle_errorinfo(con)); -@@ -308,8 +287,8 @@ bind_err: - OCIHandleFree(stmthp, OCI_HTYPE_STMT); - return 0; - default: -- pass = -pass; -- break; -+ LM_ERR("timeout/not connected to oracle\n"); -+ break; - } - - ora_err: -@@ -317,15 +296,13 @@ ora_err: - stop_exec: - if (stmthp) - OCIHandleFree(stmthp, OCI_HTYPE_STMT); -- if (pass == -1 && !con->connected) { -- /* Attemtp to reconnect */ -- if (db_oracle_reconnect(con) == OCI_SUCCESS) { -- LM_NOTICE("attempt repeat after reconnect\n"); -- pass = 0; -- goto repeat; -- } -+ LM_INFO("reconnecting to oracle...\n"); -+ /* Attempt to reconnect */ -+ if (db_oracle_reconnect(con) == OCI_SUCCESS) -+ LM_INFO("connection restored\n"); -+ else - LM_ERR("connection loss\n"); -- } -+ - return -4; - } - -diff --git a/modules/db_oracle/ora_con.c b/modules/db_oracle/ora_con.c -index 0b79df362..60c8ef555 100644 ---- a/modules/db_oracle/ora_con.c -+++ b/modules/db_oracle/ora_con.c -@@ -20,9 +20,10 @@ - - #include - #include -+#include - #include "../../mem/mem.h" - #include "../../dprint.h" --#include "asynch.h" -+#include "timer.h" - #include "ora_con.h" - - /*************************************************************************/ -@@ -103,6 +104,12 @@ bad_param: - status = OCIAttrSet(con->svchp, OCI_HTYPE_SVCCTX, con->authp, 0, - OCI_ATTR_SESSION, con->errhp); - if (status != OCI_SUCCESS) goto connect_err; -+ -+ if (init_ora_timer(con) != 0) { -+ LM_ERR("can't start oracle timer thread\n"); -+ goto drop_connection; -+ } -+ - status = db_oracle_reconnect(con); - if (status != OCI_SUCCESS) { - connect_err: -@@ -120,12 +127,11 @@ drop_connection: - } - - // timelimited operation -- status = begin_timelimit(con, 0); -- if (status != OCI_SUCCESS) goto connect_err; -- do status = OCIServerVersion(con->svchp, con->errhp, (OraText*)buf, -+ request_timer(); -+ status = OCIServerVersion(con->svchp, con->errhp, (OraText*)buf, - (ub4)sizeof(buf), OCI_HTYPE_SVCCTX); -- while (wait_timelimit(con, status)); -- if (done_timelimit(con, status)) goto drop_connection; -+ timer_stop(); -+ - if (status != OCI_SUCCESS) goto connect_err; - LM_INFO("server version is %s\n", buf); - return con; -@@ -137,6 +143,7 @@ drop_connection: - */ - void db_oracle_free_connection(ora_con_t* con) - { -+ destroy_ora_timer(con); - if (!con) return; - - if (con->connected) -@@ -162,20 +169,17 @@ void db_oracle_free_connection(ora_con_t* con) - void db_oracle_disconnect(ora_con_t* con) - { - sword status; -- -- switch (con->connected) { -- default: -- status = OCISessionEnd(con->svchp, con->errhp, con->authp, -- OCI_DEFAULT); -- if (status != OCI_SUCCESS) -- LM_ERR("driver: %s\n", db_oracle_error(con, status)); -- case 1: -+ if (con->connected > 0) { -+ if (con->connected > 1) { -+ status = OCISessionEnd(con->svchp, con->errhp, con->authp, -+ OCI_DEFAULT); -+ if (status != OCI_SUCCESS) -+ LM_ERR("driver: %s\n", db_oracle_error(con, status)); -+ } - status = OCIServerDetach(con->srvhp, con->errhp, OCI_DEFAULT); - if (status != OCI_SUCCESS) - LM_ERR("driver: %s\n", db_oracle_error(con, status)); - con->connected = 0; -- case 0: -- break; - } - } - -@@ -190,48 +194,19 @@ sword db_oracle_reconnect(ora_con_t* con) - if (con->connected) - db_oracle_disconnect(con); - -- /* timelimited operation, but OCI tcp-network does not support it :( */ -+ restore_timer(); - status = OCIServerAttach(con->srvhp, con->errhp, (OraText*)con->uri, - con->uri_len, 0); -+ timer_stop(); - if (status == OCI_SUCCESS) { - ++con->connected; -- /* -- * timelimited operation, but OCI has BUG in asynch -- * implementation of OCISessionBegin :(. -- * -- * Next code is 'empiric hack' that work (tested) in v10/v11. -- */ -- status = begin_timelimit(con, 1); -- if (status != OCI_SUCCESS) goto done; -+ request_timer(); - status = OCISessionBegin(con->svchp, con->errhp, con->authp, - OCI_CRED_RDBMS, OCI_DEFAULT); -- while (wait_timelimit(con, status)) { -- sword code; -- -- status = OCIServerVersion(con->svchp, con->errhp, NULL, -- 0, OCI_HTYPE_SVCCTX); -- -- if ( status != OCI_ERROR -- || OCIErrorGet(con->errhp, 1, NULL, &code, NULL, 0, -- OCI_HTYPE_ERROR) != OCI_SUCCESS) break; -- switch (code) { -- case 24909: /* other call in progress */ -- status = OCI_STILL_EXECUTING; -- continue; -- -- case 3127: /* no new operation until active ends */ -- status = OCISessionBegin(con->svchp, con->errhp, -- con->authp, OCI_CRED_RDBMS, OCI_DEFAULT); -- default: -- break; -- } -- break; -- } -- if (done_timelimit(con, status)) goto done; -+ timer_stop(); - - if (status == OCI_SUCCESS) - ++con->connected; - } --done: - return status; - } -diff --git a/modules/db_oracle/ora_con.h b/modules/db_oracle/ora_con.h -index 8fd7570e0..1e59eeb9b 100644 ---- a/modules/db_oracle/ora_con.h -+++ b/modules/db_oracle/ora_con.h -@@ -53,6 +53,7 @@ struct ora_con { - - int connected; /* Authorized session started */ - int bindpos; /* Last Bind handle position */ -+ pthread_t timer; - - query_data_t* pqdata; /* Temporary: cb data for submit_query/store_result */ - -diff --git a/modules/db_oracle/res.c b/modules/db_oracle/res.c -index 3c54bce20..a6935249a 100644 ---- a/modules/db_oracle/res.c -+++ b/modules/db_oracle/res.c -@@ -30,7 +30,7 @@ - #include "../../dprint.h" - #include "ora_con.h" - #include "dbase.h" --#include "asynch.h" -+#include "timer.h" - #include "res.h" - - -@@ -52,6 +52,10 @@ struct dmap { - }; - typedef struct dmap dmap_t; - -+typedef struct ora_row { -+ struct db_row hdr; -+ struct ora_row* next; -+} ora_row_t; - - /* - * Get and convert columns from a result. Define handlers and buffers -@@ -360,66 +364,74 @@ static int convert_row(db_res_t* _res, db_row_t* _r, dmap_t* _d) - */ - static int get_rows(ora_con_t* con, db_res_t* _r, OCIStmt* _c, dmap_t* _d) - { -- ub4 rcnt; -+ ub4 i = 0, rcnt = 0; - sword status; - unsigned n = RES_COL_N(_r); -- -+ // Since OCI have not "mysql_num_rows()", sequentialy fetch all rows into tmp area orow_list. -+ // Then call db_allocate_rows() and copy tmp to db module. -+ ora_row_t *orow_list = NULL, *orow_it, *orow_tail; -+ - memcpy(_d->len, _d->ilen, sizeof(_d->len[0]) * n); -- -- // timelimited operation -- status = begin_timelimit(con, 0); -- if (status != OCI_SUCCESS) goto ora_err; -- do status = OCIStmtFetch2(_c, con->errhp, 1, OCI_FETCH_NEXT, 0, -- OCI_DEFAULT); -- while (wait_timelimit(con, status)); -- if (done_timelimit(con, status)) goto stop_load; -- if (status != OCI_SUCCESS) { -- if (status != OCI_NO_DATA) -- goto ora_err; -- -- RES_ROW_N(_r) = 0; -- RES_ROWS(_r) = NULL; -- return 0; -- } -- -- status = OCIAttrGet(_c, OCI_HTYPE_STMT, &rcnt, NULL, -- OCI_ATTR_CURRENT_POSITION, con->errhp); -- if (status != OCI_SUCCESS) goto ora_err; -- if (!rcnt) { -- LM_ERR("lastpos==0\n"); -- goto stop_load; -+ -+ request_timer(); -+ while ((status = OCIStmtFetch2(_c, con->errhp, 1, OCI_FETCH_NEXT, 0, -+ OCI_DEFAULT)) == OCI_SUCCESS) { -+ timer_stop(); -+ -+ orow_it = (ora_row_t*) pkg_malloc(sizeof(ora_row_t) + sizeof(db_val_t)*RES_COL_N(_r)); -+ if (orow_it == NULL) { -+ LM_ERR("no private memory left\n"); -+ goto stop_load; -+ } -+ memset(orow_it, 0, sizeof(ora_row_t) + sizeof(db_val_t)*RES_COL_N(_r)); -+ orow_it->hdr.values = (db_val_t*)(orow_it+1); -+ -+ if (orow_list == NULL) -+ orow_list = orow_it; -+ else -+ orow_tail->next = orow_it; -+ orow_tail = orow_it; -+ -+ if (convert_row(_r, &orow_it->hdr, _d) < 0) { -+ LM_ERR("erroc convert row\n"); -+ goto stop_load; -+ } -+ memcpy(_d->len, _d->ilen, sizeof(_d->len[0]) * n); -+ ++rcnt; -+ request_timer(); - } -- -+ timer_stop(); -+ if (status != OCI_NO_DATA) -+ goto ora_err; -+ - RES_ROW_N(_r) = rcnt; - if (db_allocate_rows( _r, rcnt)!=0) { - LM_ERR("no private memory left\n"); -- return -1; -+ goto stop_load; - } -- -- while ( 1 ) { -- if (convert_row(_r, &RES_ROWS(_r)[--rcnt], _d) < 0) { -- LM_ERR("error convert row\n"); -- goto stop_load; -- } -- -- if (!rcnt) -- return 0; -- -- memcpy(_d->len, _d->ilen, sizeof(_d->len[0]) * n); -- // timelimited operation -- status = begin_timelimit(con, 0); -- if (status != OCI_SUCCESS) goto ora_err; -- do status = OCIStmtFetch2(_c, con->errhp, 1, OCI_FETCH_PRIOR, 0, -- OCI_DEFAULT); -- while (wait_timelimit(con, status)); -- if (done_timelimit(con, status)) goto stop_load; -- if (status != OCI_SUCCESS) break; -+ -+ for (orow_it = orow_list; orow_it; orow_it = orow_it->next) { -+ memcpy(ROW_VALUES(&RES_ROWS(_r)[i]), ROW_VALUES(&orow_it->hdr), sizeof(db_val_t)*RES_COL_N(_r)); -+ ROW_N(&RES_ROWS(_r)[i]) = ROW_N(&orow_it->hdr); -+ ++i; - } -+ -+ for (orow_it = orow_list; orow_it; orow_it = orow_list) { -+ orow_list = orow_it->next; -+ pkg_free(orow_it); -+ orow_it = NULL; -+ } -+ return 0; -+ - ora_err: - LM_ERR("driver: %s\n", db_oracle_error(con, status)); - stop_load: -- db_free_rows(_r); -- RES_ROW_N(_r) = 0; /* TODO: skipped in db_res.c :) */ -+ for (orow_it = orow_list; orow_it; orow_it = orow_list) { -+ orow_list = orow_it->next; -+ db_free_row(&orow_it->hdr); -+ pkg_free(orow_it); -+ orow_it = NULL; -+ } - return -3; - } - -diff --git a/modules/db_oracle/timer.c b/modules/db_oracle/timer.c -new file mode 100644 -index 000000000..50484f43a ---- /dev/null -+++ b/modules/db_oracle/timer.c -@@ -0,0 +1,131 @@ -+#include "timer.h" -+#include "../../dprint.h" -+#include "../../sr_module.h" -+ -+#include -+#include -+#include -+#include -+ -+#define MAX_TIMEOUT_S 10 -+#define MIN_TIMEOUT_MCS 100000 -+ -+/* Default is 3.0 second */ -+struct itimerval request_tm = {{0,0}, {3,0}}; -+// unsigned request_tm; -+ -+/* Default is 0.2 second */ -+struct itimerval restore_tm = {{0,0}, {0,200000}}; -+ -+struct itimerval stop_tm = {{0,0}, {0,0}}; -+ -+/* Simple error handling functions */ -+ -+#define handle_error_en(en, msg) \ -+ do { LM_ERR(msg": %s\n", strerror(en)); return 1; } while (0) -+ -+static ora_con_t *g_con; -+ -+static int set_tv(unsigned type, const char* val, struct timeval* tv) -+{ -+ char *eptr; -+ struct itimerval tt; -+ unsigned long s, ms; -+ double dv; -+ -+ if (type != STR_PARAM) { -+ LM_ERR("type of parameter is no STR\n"); -+ return -1; -+ } -+ -+ if (!val || !*val) { -+ LM_ERR("empty parameter\n"); -+ return -1; -+ } -+ -+ errno = 0; -+ dv = strtod(val, &eptr); -+ -+ if (*eptr) { -+ LM_ERR("invalid parameter string\n"); -+ return -2; -+ } -+ -+ if ( errno -+ || dv > (double)MAX_TIMEOUT_S -+ || (dv < ((double)MIN_TIMEOUT_MCS)/100000)) -+ { -+ LM_ERR("value must be between 0.%.6u and %u.0\n", -+ MIN_TIMEOUT_MCS, MAX_TIMEOUT_S); -+ return -3; -+ } -+ -+ s = (unsigned)dv; -+ dv -= (double)s; -+ ms = (unsigned)(dv * 1000000); -+ tv->tv_sec = (time_t)s; -+ tv->tv_usec = (suseconds_t)ms; -+ return 0; -+} -+ -+ -+/* -+ * set operation timeout -+ */ -+int set_timeout(unsigned type, const char* val) -+{ -+ return set_tv(type, val, &request_tm.it_value); -+} -+ -+ -+/* -+ * set (re)connect timeout -+ */ -+int set_reconnect(unsigned type, const char* val) -+{ -+ return set_tv(type, val, &restore_tm.it_value); -+} -+ -+void ora_alarm_handle(int sig) { -+ LM_INFO("ora_alarm_handle\n"); -+ sword status; -+ status = OCIBreak(g_con->svchp, g_con->errhp); -+ if (status != OCI_SUCCESS) { -+ LM_ERR("OCIBreak: %s\n", db_oracle_error(g_con, status)); -+ } -+} -+ -+int init_ora_timer(ora_con_t* con) { -+ g_con = con; -+ struct sigaction sa; -+ memset(&sa, 0, sizeof(sa)); -+ sa.sa_handler = ora_alarm_handle; -+ if (sigaction(SIGALRM, &sa, NULL) < -1) -+ handle_error_en(errno, "sigaction"); -+ -+ return 0; -+} -+ -+int destroy_ora_timer() -+{ -+ timer_stop(); -+} -+ -+void request_timer() -+{ -+ if (setitimer(ITIMER_REAL, &request_tm, NULL) < 0) -+ LM_ERR("setitimer: %s\n", strerror(errno)); -+} -+ -+void restore_timer() -+{ -+ if (setitimer(ITIMER_REAL, &restore_tm, NULL) < 0) -+ LM_ERR("setitimer: %s\n", strerror(errno)); -+} -+ -+void timer_stop() -+{ -+ if (setitimer(ITIMER_REAL, &stop_tm, NULL) < 0) -+ LM_ERR("setitimer: %s\n", strerror(errno)); -+} -+ -\ No newline at end of file -diff --git a/modules/db_oracle/timer.h b/modules/db_oracle/timer.h -new file mode 100644 -index 000000000..24aa4a973 ---- /dev/null -+++ b/modules/db_oracle/timer.h -@@ -0,0 +1,22 @@ -+#ifndef ORA_TIMER_H -+#define ORA_TIMER_H -+ -+#include "ora_con.h" -+ -+/* -+ * parse timeout value for operation in syntax: nnn.mmm (sec/ms) -+ */ -+int set_timeout(unsigned type, const char* val); -+ -+/* -+ * parse timeout value for reconnect in syntax: nnn.mmm (sec/ms) -+ */ -+int set_reconnect(unsigned type, const char* val); -+ -+int init_ora_timer(ora_con_t* con); -+int destroy_ora_timer(); -+ -+void request_timer(); -+void restore_timer(); -+void timer_stop(); -+#endif // ORA_TIMER_H -\ No newline at end of file diff --git a/opensips-0003-db_ora-null-terminating-string-is-more-safely-most-m.patch b/opensips-0003-db_ora-null-terminating-string-is-more-safely-most-m.patch new file mode 100644 index 0000000..dd475df --- /dev/null +++ b/opensips-0003-db_ora-null-terminating-string-is-more-safely-most-m.patch @@ -0,0 +1,24 @@ +From: dronord +Date: Fri, 3 Nov 2017 17:05:35 +0300 +Subject: [PATCH] db_ora: null-terminating string is more safely, most modules + use VAL_STRING, not VAL_STR. + + +diff --git a/modules/db_oracle/res.c b/modules/db_oracle/res.c +index 22378048e..45d60f6a4 100644 +--- a/modules/db_oracle/res.c ++++ b/modules/db_oracle/res.c +@@ -213,10 +213,10 @@ set_flt: + case SQLT_AFC: /* Ansi fixed char */ + case SQLT_AVC: /* Ansi Var char */ + // case SQLT_RID: /* rowid */ +- LM_DBG("use DB_STR result type\n"); +- RES_TYPES(_r)[i] = DB_STR; ++ LM_DBG("use DB_STRING result type\n"); ++ RES_TYPES(_r)[i] = DB_STRING; + dyn_str: +- dtype = SQLT_CHR; ++ dtype = SQLT_STR; + len = 0; /* DATA_SIZE is ub2 */ + status = OCIAttrGet(param, OCI_DTYPE_PARAM, + (dvoid**)(dvoid*)&len, NULL, OCI_ATTR_DATA_SIZE, diff --git a/opensips-0004-Return-actual-payload-ID-in-case-of-a-dynamic-payloa.patch b/opensips-0004-Return-actual-payload-ID-in-case-of-a-dynamic-payloa.patch new file mode 100644 index 0000000..d773e7f --- /dev/null +++ b/opensips-0004-Return-actual-payload-ID-in-case-of-a-dynamic-payloa.patch @@ -0,0 +1,29 @@ +From: Peter Lemenkov +Date: Fri, 11 Jan 2013 14:40:08 +0400 +Subject: [PATCH] Return actual payload ID in case of a dynamic payload + +Signed-off-by: Peter Lemenkov + +diff --git a/modules/sipmsgops/codecs.c b/modules/sipmsgops/codecs.c +index 4499a457f..dbe9a17cf 100644 +--- a/modules/sipmsgops/codecs.c ++++ b/modules/sipmsgops/codecs.c +@@ -32,6 +32,7 @@ + #include "codecs.h" + #include "../../route.h" + #include "../../mod_fix.h" ++#include "../../ut.h" + + #define MAX_STREAMS 64 + +@@ -528,7 +529,9 @@ static int stream_process(struct sip_msg * msg, struct sdp_stream_cell *cell, + + if(op == FIND) + { +- ret = 1; ++ str2sint(&(payload->rtp_payload), &ret); ++ if( (ret >= 0) && (ret <= 34) ) /* if a fixed payload ID then just return 1 */ ++ ret = 1; + goto end; + } + diff --git a/opensips-0004-db_oracle-Fix-default-ret-result.patch b/opensips-0004-db_oracle-Fix-default-ret-result.patch deleted file mode 100644 index cd4ddc4..0000000 --- a/opensips-0004-db_oracle-Fix-default-ret-result.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Peter Lemenkov -Date: Tue, 14 Aug 2012 15:43:46 +0400 -Subject: [PATCH] [db_oracle] Fix default ret result - -Signed-off-by: Peter Lemenkov - -diff --git a/modules/db_oracle/res.c b/modules/db_oracle/res.c -index a6935249a..6866e4bcf 100644 ---- a/modules/db_oracle/res.c -+++ b/modules/db_oracle/res.c -@@ -213,8 +213,8 @@ set_int: - case SQLT_AFC: /* Ansi fixed char */ - case SQLT_AVC: /* Ansi Var char */ - // case SQLT_RID: /* rowid */ -- LM_DBG("use DB_STR result type\n"); -- RES_TYPES(_r)[i] = DB_STR; -+ LM_DBG("use DB_STRING result type\n"); -+ RES_TYPES(_r)[i] = DB_STRING; - dyn_str: - dtype = SQLT_CHR; - len = 0; /* DATA_SIZE is ub2 */ diff --git a/opensips-0005-Return-actual-payload-ID-in-case-of-a-dynamic-payloa.patch b/opensips-0005-Return-actual-payload-ID-in-case-of-a-dynamic-payloa.patch deleted file mode 100644 index d773e7f..0000000 --- a/opensips-0005-Return-actual-payload-ID-in-case-of-a-dynamic-payloa.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Peter Lemenkov -Date: Fri, 11 Jan 2013 14:40:08 +0400 -Subject: [PATCH] Return actual payload ID in case of a dynamic payload - -Signed-off-by: Peter Lemenkov - -diff --git a/modules/sipmsgops/codecs.c b/modules/sipmsgops/codecs.c -index 4499a457f..dbe9a17cf 100644 ---- a/modules/sipmsgops/codecs.c -+++ b/modules/sipmsgops/codecs.c -@@ -32,6 +32,7 @@ - #include "codecs.h" - #include "../../route.h" - #include "../../mod_fix.h" -+#include "../../ut.h" - - #define MAX_STREAMS 64 - -@@ -528,7 +529,9 @@ static int stream_process(struct sip_msg * msg, struct sdp_stream_cell *cell, - - if(op == FIND) - { -- ret = 1; -+ str2sint(&(payload->rtp_payload), &ret); -+ if( (ret >= 0) && (ret <= 34) ) /* if a fixed payload ID then just return 1 */ -+ ret = 1; - goto end; - } - diff --git a/opensips-0005-Use-additional-auth-field-Sip-Source-IP-Address.patch b/opensips-0005-Use-additional-auth-field-Sip-Source-IP-Address.patch new file mode 100644 index 0000000..c414254 --- /dev/null +++ b/opensips-0005-Use-additional-auth-field-Sip-Source-IP-Address.patch @@ -0,0 +1,59 @@ +From: Peter Lemenkov +Date: Wed, 10 Aug 2011 17:30:51 +0400 +Subject: [PATCH] Use additional auth field - Sip-Source-IP-Address + +Signed-off-by: Peter Lemenkov + +diff --git a/aaa/aaa_avp.h b/aaa/aaa_avp.h +index 08a3131e9..2c215f740 100644 +--- a/aaa/aaa_avp.h ++++ b/aaa/aaa_avp.h +@@ -56,7 +56,8 @@ + #define A_TIME_STAMP 28 + #define A_SIP_CALL_ID 29 + #define A_SIP_REQUEST_HASH 30 +-#define A_MAX 31 ++#define A_SIP_SOURCE_IP_ADDRESS 31 ++#define A_MAX 32 + + #define V_STATUS_START 0 + #define V_STATUS_STOP 1 +diff --git a/modules/auth_aaa/authaaa_mod.c b/modules/auth_aaa/authaaa_mod.c +index 5b230cf58..bc1ea8603 100644 +--- a/modules/auth_aaa/authaaa_mod.c ++++ b/modules/auth_aaa/authaaa_mod.c +@@ -139,6 +139,7 @@ static int mod_init(void) + memset(vals, 0, sizeof(vals)); + attrs[A_SERVICE_TYPE].name = "Service-Type"; + attrs[A_SIP_URI_USER].name = "Sip-URI-User"; ++ attrs[A_SIP_SOURCE_IP_ADDRESS].name = "Sip-Source-IP-Address"; + attrs[A_DIGEST_RESPONSE].name = "Digest-Response"; + attrs[A_DIGEST_ALGORITHM].name = "Digest-Algorithm"; + attrs[A_DIGEST_BODY_DIGEST].name = "Digest-Body-Digest"; +diff --git a/modules/auth_aaa/sterman.c b/modules/auth_aaa/sterman.c +index 92df9b9bd..a0fa42aa1 100644 +--- a/modules/auth_aaa/sterman.c ++++ b/modules/auth_aaa/sterman.c +@@ -87,6 +87,7 @@ int aaa_authorize_sterman(struct sip_msg* _msg, dig_cred_t* _cred, str* _method, + uint32_t service; + str method, user, user_name; + str *ruri; ++ str ip; + + send = received = NULL; + +@@ -229,6 +230,14 @@ int aaa_authorize_sterman(struct sip_msg* _msg, dig_cred_t* _cred, str* _method, + goto err; + } + ++ /* Add SIP source IP address as a check item */ ++ ip.s = ip_addr2a(&_msg->rcv.src_ip); ++ ip.len = strlen(ip.s); ++ if (proto.avp_add(conn, send, &attrs[A_SIP_SOURCE_IP_ADDRESS], ip.s,ip.len,0)) { ++ LM_ERR("unable to add Sip-URI-User attribute\n"); ++ goto err; ++ } ++ + /* Add CALL-ID in Acct-Session-Id Attribute */ + if ( _msg->callid==NULL && + (parse_headers(_msg, HDR_CALLID_F, 0)==-1 || _msg->callid==NULL) ) { diff --git a/opensips-0006-Don-t-remove-pthread-library-explicitly-from-mi_xmlr.patch b/opensips-0006-Don-t-remove-pthread-library-explicitly-from-mi_xmlr.patch new file mode 100644 index 0000000..7c66faf --- /dev/null +++ b/opensips-0006-Don-t-remove-pthread-library-explicitly-from-mi_xmlr.patch @@ -0,0 +1,28 @@ +From: Peter Lemenkov +Date: Wed, 26 Mar 2014 13:10:07 +0400 +Subject: [PATCH] Don't remove pthread library explicitly from mi_xmlrpc + +Signed-off-by: Peter Lemenkov + +diff --git a/obsolete_modules/mi_xmlrpc/Makefile b/obsolete_modules/mi_xmlrpc/Makefile +index 762c2dda2..955528f10 100644 +--- a/obsolete_modules/mi_xmlrpc/Makefile ++++ b/obsolete_modules/mi_xmlrpc/Makefile +@@ -76,7 +76,7 @@ ifeq ($(NEW),yes) + # remove the abyss library - we already have + # the code in the module + MY_DEFS+=-D_UNIX +- MY_LIBS:=$(filter-out %xmlrpc_abyss %xmlrpc_server_abyss %pthread, $(MY_LIBS)) ++ MY_LIBS:=$(filter-out %xmlrpc_abyss %xmlrpc_server_abyss, $(MY_LIBS)) + else + # remove from compiling the code we have in the + # module for abyss server +@@ -90,7 +90,7 @@ endif + + + DEFS+=$(MY_DEFS) +-LIBS=$(MY_LIBS) ++LIBS=$(MY_LIBS) -lpthread + + + include ../../Makefile.modules diff --git a/opensips-0006-Use-additional-auth-field-Sip-Source-IP-Address.patch b/opensips-0006-Use-additional-auth-field-Sip-Source-IP-Address.patch deleted file mode 100644 index 188d771..0000000 --- a/opensips-0006-Use-additional-auth-field-Sip-Source-IP-Address.patch +++ /dev/null @@ -1,59 +0,0 @@ -From: Peter Lemenkov -Date: Wed, 10 Aug 2011 17:30:51 +0400 -Subject: [PATCH] Use additional auth field - Sip-Source-IP-Address - -Signed-off-by: Peter Lemenkov - -diff --git a/aaa/aaa_avp.h b/aaa/aaa_avp.h -index 08a3131e9..2c215f740 100644 ---- a/aaa/aaa_avp.h -+++ b/aaa/aaa_avp.h -@@ -56,7 +56,8 @@ - #define A_TIME_STAMP 28 - #define A_SIP_CALL_ID 29 - #define A_SIP_REQUEST_HASH 30 --#define A_MAX 31 -+#define A_SIP_SOURCE_IP_ADDRESS 31 -+#define A_MAX 32 - - #define V_STATUS_START 0 - #define V_STATUS_STOP 1 -diff --git a/modules/auth_aaa/authaaa_mod.c b/modules/auth_aaa/authaaa_mod.c -index 588eed761..184dcee40 100644 ---- a/modules/auth_aaa/authaaa_mod.c -+++ b/modules/auth_aaa/authaaa_mod.c -@@ -138,6 +138,7 @@ static int mod_init(void) - memset(vals, 0, sizeof(vals)); - attrs[A_SERVICE_TYPE].name = "Service-Type"; - attrs[A_SIP_URI_USER].name = "Sip-URI-User"; -+ attrs[A_SIP_SOURCE_IP_ADDRESS].name = "Sip-Source-IP-Address"; - attrs[A_DIGEST_RESPONSE].name = "Digest-Response"; - attrs[A_DIGEST_ALGORITHM].name = "Digest-Algorithm"; - attrs[A_DIGEST_BODY_DIGEST].name = "Digest-Body-Digest"; -diff --git a/modules/auth_aaa/sterman.c b/modules/auth_aaa/sterman.c -index 92df9b9bd..a0fa42aa1 100644 ---- a/modules/auth_aaa/sterman.c -+++ b/modules/auth_aaa/sterman.c -@@ -87,6 +87,7 @@ int aaa_authorize_sterman(struct sip_msg* _msg, dig_cred_t* _cred, str* _method, - uint32_t service; - str method, user, user_name; - str *ruri; -+ str ip; - - send = received = NULL; - -@@ -229,6 +230,14 @@ int aaa_authorize_sterman(struct sip_msg* _msg, dig_cred_t* _cred, str* _method, - goto err; - } - -+ /* Add SIP source IP address as a check item */ -+ ip.s = ip_addr2a(&_msg->rcv.src_ip); -+ ip.len = strlen(ip.s); -+ if (proto.avp_add(conn, send, &attrs[A_SIP_SOURCE_IP_ADDRESS], ip.s,ip.len,0)) { -+ LM_ERR("unable to add Sip-URI-User attribute\n"); -+ goto err; -+ } -+ - /* Add CALL-ID in Acct-Session-Id Attribute */ - if ( _msg->callid==NULL && - (parse_headers(_msg, HDR_CALLID_F, 0)==-1 || _msg->callid==NULL) ) { diff --git a/opensips-0007-Don-t-remove-pthread-library-explicitly-from-mi_xmlr.patch b/opensips-0007-Don-t-remove-pthread-library-explicitly-from-mi_xmlr.patch deleted file mode 100644 index 7c66faf..0000000 --- a/opensips-0007-Don-t-remove-pthread-library-explicitly-from-mi_xmlr.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Peter Lemenkov -Date: Wed, 26 Mar 2014 13:10:07 +0400 -Subject: [PATCH] Don't remove pthread library explicitly from mi_xmlrpc - -Signed-off-by: Peter Lemenkov - -diff --git a/obsolete_modules/mi_xmlrpc/Makefile b/obsolete_modules/mi_xmlrpc/Makefile -index 762c2dda2..955528f10 100644 ---- a/obsolete_modules/mi_xmlrpc/Makefile -+++ b/obsolete_modules/mi_xmlrpc/Makefile -@@ -76,7 +76,7 @@ ifeq ($(NEW),yes) - # remove the abyss library - we already have - # the code in the module - MY_DEFS+=-D_UNIX -- MY_LIBS:=$(filter-out %xmlrpc_abyss %xmlrpc_server_abyss %pthread, $(MY_LIBS)) -+ MY_LIBS:=$(filter-out %xmlrpc_abyss %xmlrpc_server_abyss, $(MY_LIBS)) - else - # remove from compiling the code we have in the - # module for abyss server -@@ -90,7 +90,7 @@ endif - - - DEFS+=$(MY_DEFS) --LIBS=$(MY_LIBS) -+LIBS=$(MY_LIBS) -lpthread - - - include ../../Makefile.modules diff --git a/opensips-0007-Dont-try-modifying-CFLAGS.patch b/opensips-0007-Dont-try-modifying-CFLAGS.patch new file mode 100644 index 0000000..fea6b59 --- /dev/null +++ b/opensips-0007-Dont-try-modifying-CFLAGS.patch @@ -0,0 +1,536 @@ +From: Peter Lemenkov +Date: Sun, 2 Dec 2018 11:17:55 +0300 +Subject: [PATCH] Dont' try modifying CFLAGS + +Signed-off-by: Peter Lemenkov + +diff --git a/Makefile.defs b/Makefile.defs +index 210428101..f7111761f 100644 +--- a/Makefile.defs ++++ b/Makefile.defs +@@ -793,525 +793,8 @@ endif + CFLAGS=$(shell echo "$${CFLAGS}") + LDFLAGS+= + +-ifneq (,$(findstring DBG_MALLOC, $(DEFS))) +- CC_OPTIMIZE_FLAG?=-O0 +-endif +- +-ifeq ($(CC_NAME), gcc) +- CC_OPTIMIZE_FLAG?=-O9 +-endif +-ifeq ($(CC_NAME), icc) +- CC_OPTIMIZE_FLAG?=-O3 +-endif +-ifeq ($(CC_NAME), clang) +- CC_OPTIMIZE_FLAG?=-O3 +-endif +- + ifeq (,$(CFLAGS)) + +-#common stuff +-CFLAGS+=$(DEBUGSYM) +- +-# setting more CFLAGS +-ifeq ($(mode), release) +- +-#if i386 +-ifeq ($(ARCH), i386) +- # These CPU optimization assumes that you run a Intel processor. +- # If you use a AMD CPU, you could ajust the settings here for better +- # performance. For gcc 4.x use CPU_TYPE ?= athlon-xp +- # if gcc +-ifeq ($(CC_NAME), gcc) +- #common stuff +- CFLAGS+=-m32 $(CC_OPTIMIZE_FLAG) -funroll-loops -Wcast-align $(PROFILE) \ +- -Wall +- LDFLAGS+=-m32 +- #if gcc 4.0+ +-ifeq ($(CC_CLASS), 4.x) +- ARCH_VER=$(shell $(GETARCH)) +-ifeq ($(ARCH_VER), i386) +- CPU_TYPE ?= i686 +-else +- CPU_TYPE ?= prescott +-endif +- CFLAGS+=-minline-all-stringops \ +- -falign-loops \ +- -ftree-vectorize \ +- -mtune=$(CPU_TYPE) \ +- -Wold-style-definition -Wmissing-field-initializers -Wredundant-decls +- +-else +- #if gcc 3.0+ +-ifeq ($(CC_CLASS), 3.x) +- CPU_TYPE ?= pentium4 +- CFLAGS+=-minline-all-stringops \ +- -falign-loops +-ifeq (X,$(shell echo "$(CC_SHORTVER)" | sed -e 's/3\.[0-3]/X/')) +- CFLAGS+=-mcpu=$(CPU_TYPE) +-else +- CFLAGS+=-mtune=$(CPU_TYPE) +-endif +-else +-ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) +-$(warning Old gcc detected ($(CC_SHORTVER)), use gcc >= 3.1 \ +- for better results) +- +- CFLAGS+=-m486 \ +- -malign-loops=4 +-else +- #really old version +-$(warning You are using an old and unsupported gcc \ +- version ($(CC_SHORTVER)), compile at your own risk!) +- +-endif # CC_CLASS, 2.9x +-endif # CC_CLASS, 3.x +-endif # CC_CLASS, 4.x +- +-else # CC_NAME, gcc +-ifeq ($(CC_NAME), icc) +- CFLAGS+=$(CC_OPTIMIZE_FLAG) -ipo -ipo_obj -unroll $(PROFILE) \ +- -tpp6 -xK #-openmp #optimize for PIII +- # -prefetch doesn't seem to work +- #( ty to inline acroos files, unroll loops,prefetch, +- # optimize for PIII, use PIII instructions & vect., +- # mutlithread loops) +-else #CC_NAME, icc +-ifeq ($(CC_NAME), suncc) +- CFLAGS+=-xO5 -fast -native -xCC \ +- -xc99=no_lib # C99 support +- # -Dinline="" # add this if cc < 5.3 (define inline as null) +-else +-ifeq ($(CC_NAME), clang) +- CFLAGS+=$(CC_OPTIMIZE_FLAG) -Wall -funroll-loops +-else +- #other compilers +-$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) +-endif #CC_NAME, clang +-endif #CC_NAME, suncc +-endif #CC_NAME, icc +-endif #CC_NAME, gcc +-endif #ARCH, i386 +- +-#x86_64 +-ifeq ($(ARCH), x86_64) +- # These CPU optimization assumes that you run a Intel 64 processor. +- # If you use a AMD 64 CPU, you could ajust the settings here for better +- # performance. For gcc 4.x use CPU_TYPE ?= athlon64 +- # Perhaps it makes sense to use '-m64' here? +- # if gcc +-ifeq ($(CC_NAME), gcc) +- #common stuff +- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops -Wcast-align $(PROFILE) \ +- -Wall +- #if gcc 4.0+ +-ifeq ($(CC_CLASS), 4.x) +- CPU_TYPE ?= nocona +- CFLAGS+=-minline-all-stringops \ +- -falign-loops \ +- -ftree-vectorize \ +- -mtune=$(CPU_TYPE) \ +- -Wold-style-definition -Wmissing-field-initializers -Wredundant-decls +-else +- #if gcc 3.0+ +-ifeq ($(CC_CLASS), 3.x) +- CPU_TYPE ?= nocona +- CFLAGS+=-minline-all-stringops \ +- -falign-loops \ +- -mtune=$(CPU_TYPE) +-else +-ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) +-$(warning Old gcc detected ($(CC_SHORTVER)), use gcc >= 3.1 \ +- for better results) +- +- CFLAGS+=-m486 \ +- -malign-loops=4 +-else +- #really old version +-$(warning You are using an old and unsupported gcc \ +- version ($(CC_SHORTVER)), compile at your own risk!) +- +-endif # CC_CLASS, 2.9x +-endif # CC_CLASS, 3.x +-endif # CC_CLASS, 4.x +- +-else # CC_NAME, gcc +-ifeq ($(CC_NAME), icc) +- CFLAGS+=$(CC_OPTIMIZE_FLAG) -ipo -ipo_obj -unroll $(PROFILE) \ +- -tpp6 -xK #-openmp #optimize for PIII +- # -prefetch doesn't seem to work +- #( ty to inline acroos files, unroll loops,prefetch, +- # optimize for PIII, use PIII instructions & vect., +- # mutlithread loops) +-else +-ifeq ($(CC_NAME), suncc) +- CFLAGS+=-xO5 -fast -native -xCC \ +- -xc99=no_lib # C99 support +- # -Dinline="" # add this if cc < 5.3 (define inline as null) +-else +-ifeq ($(CC_NAME), clang) +- CFLAGS+=$(CC_OPTIMIZE_FLAG) -Wall -funroll-loops +-else +- #other compilers +-$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) +-endif #CC_NAME, clang +-endif #CC_NAME, icc +-endif #CC_NAME, gcc +-endif #CC_NAME, suncc +-endif #ARCH, x86_64 +- +- #if sparc +-ifeq ($(ARCH), sparc64) +- #if gcc +-ifeq ($(CC_NAME), gcc) +- #common stuff +- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops $(PROFILE) \ +- -Wall\ +- #-Wcast-align \ +- #-Wmissing-prototypes +- #if gcc 4.x +-ifeq ($(CC_CLASS), 4.x) +- +- # Processors of Family UltraSparc II +- ifeq ($(CHIP), ultrasparc-ii) +- CFLAGS+= -ftree-vectorize -mcpu=ultrasparc -mtune=ultrasparc -mvis +- endif +- +- # Processors of Family UltraSparc III (III, III, IIIi, IIICu) +- ifeq ($(CHIP), ultrasparc-iiii) +- CFLAGS+= -ftree-vectorize -mcpu=ultrasparc3 -mtune=ultrasparc3 -mvis +- endif +- +- ifeq ($(CHIP), ultrasparc-iii) +- CFLAGS+= -ftree-vectorize -mcpu=ultrasparc3 -mtune=ultrasparc3 -mvis +- endif +- +- ifeq ($(CHIP), ultrasparc-iiicu) +- CFLAGS+= -ftree-vectorize -mcpu=ultrasparc3 -mtune=ultrasparc3 -mvis +- endif +- +- # Processors of Family UltraSparc T1 +- ifeq ($(CHIP), ultrasparc-t1) +- # niagara switch is not supported on GCC < 4.2 +- # Sets to default ultrasparc +- ifeq ($(CC_SHORTVER), 4.2) +- CFLAGS+= -ftree-vectorize -mcpu=niagara -mtune=niagara -mvis +- else +- ifeq ($(CC_SHORTVER), 4.3) +- CFLAGS+= -ftree-vectorize -mcpu=niagara -mtune=niagara -mvis +- else +- CFLAGS+= -ftree-vectorize -mcpu=ultrasparc -mtune=ultrasparc -mvis +- endif +- endif +- endif +- +- # If processor detection fails, defaults to UltraSPARC without VIS +- ifeq (,$(CHIP)) +- #CPU_TYPE=ultrasparc +- CFLAGS += -mcpu=ultrasparc -mtune=ultrasparc +- endif +- +- # use -m64 to force 64 bit (but add it also to LDFLAGS), +- # -m32 for 32 bit (default on solaris), +- # nothing for arch. default +- # -mcpu=v9 or ultrasparc? # -mtune implied by -mcpu +- #-mno-epilogue #try to inline function exit code +- #-mflat # omit save/restore +- #-,faster-structs #faster non Sparc ABI structure copy ops +- +-else +- #if gcc 3.0+ +-ifeq ($(CC_CLASS), 3.x) +- +- # Processors of Family UltraSparc II +- ifeq ($(CHIP), ultrasparc-ii) +- #CPU_TYPE=ultrasparc +- CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc -mvis +- endif +- +- # Processors of Family UltraSparc III +- ifeq ($(CHIP), ultrasparc-iiii) +- CFLAGS+= -mcpu=ultrasparc3 -mtune=ultrasparc3 -mvis +- endif +- +- ifeq ($(CHIP), ultrasparc-iiii) +- CFLAGS+= -mcpu=ultrasparc3 -mtune=ultrasparc3 -mvis +- endif +- +- ifeq ($(CHIP), ultrasparc-iiicu) +- CFLAGS+= -mcpu=ultrasparc3 -mtune=ultrasparc3 -mvis +- endif +- +- # Processors of Family UltraSparc T1 +- ifeq ($(CHIP), ultrasparc-t1) +- # niagara switch is not supported on GCC < 4.2 +- # Sets to default ultrasparc +- CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc -mvis +- endif +- +- # If processor detection fails, defaults to UltraSPARC without VIS +- ifeq (,$(CHIP)) +- #CPU_TYPE=ultrasparc +- CFLAGS += -mcpu=ultrasparc -mtune=ultrasparc +- endif +- +- # use -m64 to force 64 bit (but add it also to LDFLAGS), +- # -m32 for 32 bit (default on solaris), +- # nothing for arch. default +- # -mcpu=v9 or ultrasparc? # -mtune implied by -mcpu +- #-mno-epilogue #try to inline function exit code +- #-mflat # omit save/restore +- #-,faster-structs #faster non Sparc ABI structure copy ops +- +-else # CC_CLASS, 3.0 +-ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) +-$(warning Old gcc detected ($(CC_SHORTVER)), use gcc >= 3.1 \ +- for better results) +-ifneq ($(OS), netbsd) +- # on netbsd/sparc64, gcc 2.95.3 does not compile +- # opensips with -mv8 +- CFLAGS+= -mv8 +-endif +-ifeq ($(ASTYPE), solaris) +- CFLAGS+= -Wa,-xarch=v8plus +-endif +-else #CC_CLASS, 2.9x +- #really old version +-$(warning You are using an old and unsupported gcc \ +- version ($(CC_SHORTVER)), compile at your own risk!) +- +- CFLAGS+= -mv8 +-ifeq ($(ASTYPE), solaris) +- CFLAGS+= -Wa,-xarch=v8plus +-endif +- +-endif #CC_CLASS, 2.9x +-endif #CC_CLASS, 3.x +-endif #CC_CLASS, 4.x +- +-else #CC_NAME, gcc +-ifeq ($(CC_NAME), suncc) +- CFLAGS+=-xO5 -fast -native -xarch=v8plusa -xCC \ +- -xc99=no_lib # C99 support +- # -Dinline="" # add this if cc < 5.3 (define inline as null) +-else +- #other compilers +-$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) +-endif #CC_NAME, suncc +-endif #CC_NAME, gcc +-endif #ARCH, sparc64 +- +- #if ipaq/netwinder +-ifeq ($(ARCH), arm) +- # if gcc +-ifeq ($(CC_NAME), gcc) +- #common stuff +- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops -Wcast-align $(PROFILE) \ +- -Wall -marm +- #if gcc 4.x+ +-ifeq ($(CC_CLASS), 4.x) +- CFLAGS+=-mcpu=strongarm1100 -ftree-vectorize +-else +- #if gcc 3.0+ +-ifeq ($(CC_CLASS), 3.x) +- CFLAGS+= -mcpu=strongarm1100 +-else +-ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) +-$(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ +- for better results) +- +- CFLAGS+= +-else +- #really old version +-$(warning You are using an old and unsupported gcc \ +- version ($(CC_SHORTVER)), compile at your own risk!) +- +-endif # CC_CLASS, 2.9x +-endif # CC_CLASS, 3.x +-endif # CC_CLASS, 4.x +- +-else # CC_NAME, gcc +- #other compilers +-$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) +-endif #CC_NAME, gcc +-endif #ARCH, arm +- +- #if mips (R3000) +-ifeq ($(ARCH), mips) +- # if gcc +-ifeq ($(CC_NAME), gcc) +- #common stuff +- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops -Wcast-align $(PROFILE) \ +- -Wall +- #if gcc 4.0+ +-ifeq ($(CC_CLASS), 4.x) +- CFLAGS+=-mcpu=r3000 -minline-all-stringops \ +- -ftree-vectorize +-else +- #if gcc 3.0+ +-ifeq ($(CC_CLASS), 3.x) +- CFLAGS+= -mcpu=r3000 +- #-mcpu=athlon +-else +-ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) +-$(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ +- for better results) +- +- CFLAGS+=-mcpu=r3000 +-else +- #really old version +-$(warning You are using an old and unsupported gcc \ +- version ($(CC_SHORTVER)), compile at your own risk!) +- +-endif # CC_CLASS, 2.9x +-endif # CC_CLASS, 3.x +-endif # CC_CLASS, 4.x +- +-else # CC_NAME, gcc +- #other compilers +-$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) +-endif #CC_NAME, gcc +-endif #ARCH, mips +- +- #if >=mips2 (R4000, R5000, R6000 ....) +-ifeq ($(ARCH), mips2) +- # if gcc +-ifeq ($(CC_NAME), gcc) +- #common stuff +- CFLAGS+=$(CC_OPTIMIZE_FLAG) -mips2 -funroll-loops $(PROFILE) \ +- -Wall +- #if gcc 4.0+ +-ifeq ($(CC_CLASS), 4.x) +- CFLAGS+=-minline-all-stringops -ftree-vectorize +-else +- #if gcc 3.0+ +-ifeq ($(CC_CLASS), 3.x) +- CFLAGS+= +-else +-ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) +-$(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ +- for better results) +- CFLAGS+= +-else +- #really old version +-$(warning You are using an old and unsupported gcc \ +- version ($(CC_SHORTVER)), compile at your own risk!) +- +-endif # CC_CLASS, 2.9x +-endif # CC_CLASS, 3.x +-endif # CC_CLASS, 4.x +- +-else # CC_NAME, gcc +- #other compilers +-$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) +-endif #CC_NAME, gcc +-endif #ARCH, mips2 +- +-#if alpha +-ifeq ($(ARCH), alpha) +- # if gcc +-ifeq ($(CC_NAME), gcc) +- #common stuff +- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops $(PROFILE) -Wall +- #if gcc 4.0+ +-ifeq ($(CC_CLASS), 4.x) +- CFLAGS+=-minline-all-stringops +-else +- #if gcc 3.0+ +-ifeq ($(CC_CLASS), 3.x) +- CFLAGS+= +-else +-ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) +-$(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ +- for better results) +- CFLAGS+= +-else +- #really old version +-$(warning You are using an old and unsupported gcc \ +- version ($(CC_SHORTVER)), compile at your own risk!) +- +-endif # CC_CLASS, 2.9x +-endif # CC_CLASS, 3.x +-endif # CC_CLASS, 4.x +- +-else # CC_NAME, gcc +- #other compilers +-$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) +-endif #CC_NAME, gcc +-endif #ARCH, alpha +- +-#if ppc +-ifeq ($(ARCH), ppc) +- # if gcc +-ifeq ($(CC_NAME), gcc) +- #common stuff +- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops $(PROFILE) -Wall +- #if gcc 4.0+ +-ifeq ($(CC_CLASS), 4.x) +- CPU_TYPE ?= powerpc +- CFLAGS+=-ftree-vectorize \ +- -mtune=$(CPU_TYPE) -maltivec +-else +- #if gcc 3.0+ +-ifeq ($(CC_CLASS), 3.x) +- CFLAGS+= +-else +-ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) +-$(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ +- for better results) +- CFLAGS+= +-else +- #really old version +-$(warning You are using an old and unsupported gcc \ +- version ($(CC_SHORTVER)), compile at your own risk!) +- +-endif # CC_CLASS, 2.9x +-endif # CC_CLASS, 3.x +-endif # CC_CLASS, 4.x +- +-else # CC_NAME, gcc +- #other compilers +-$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) +-endif #CC_NAME, gcc +-endif #ARCH, ppc +- +-#if ppc64 +-ifeq ($(ARCH), ppc64) +- # if gcc +-ifeq ($(CC_NAME), gcc) +- #common stuff +- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops $(PROFILE) -Wall +-ifeq ($(CC_CLASS), 4.x) +- CPU_TYPE ?= powerpc64 +- CFLAGS+=-ftree-vectorize \ +- -mtune=$(CPU_TYPE) -maltivec +-else +- #if gcc 3.0+ +-ifeq ($(CC_CLASS), 3.x) +- CFLAGS+= +-else +-ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) +-$(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ +- for better results) +- CFLAGS+= +-else +- #really old version +-$(warning You are using an old and unsupported gcc \ +- version ($(CC_SHORTVER)), compile at your own risk!) +- +-endif # CC_CLASS, 2.9x +-endif # CC_CLASS, 3.x +-endif # CC_CLASS, 4.x +- +-else # CC_NAME, gcc +- #other compilers +-$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) +-endif #CC_NAME, gcc +-endif #ARCH, ppc +- +-endif # CFLAGS not set +- +-CFLAGS+= $(CC_EXTRA_OPTS) +- + LD_EXTRA_OPTS ?= + + # setting LDFLAGS diff --git a/opensips-0008-Dont-try-modifying-CFLAGS.patch b/opensips-0008-Dont-try-modifying-CFLAGS.patch deleted file mode 100644 index 9bf953f..0000000 --- a/opensips-0008-Dont-try-modifying-CFLAGS.patch +++ /dev/null @@ -1,536 +0,0 @@ -From: Peter Lemenkov -Date: Sun, 2 Dec 2018 11:17:55 +0300 -Subject: [PATCH] Dont' try modifying CFLAGS - -Signed-off-by: Peter Lemenkov - -diff --git a/Makefile.defs b/Makefile.defs -index 2a133125c..359d1593d 100644 ---- a/Makefile.defs -+++ b/Makefile.defs -@@ -793,525 +793,8 @@ endif - CFLAGS=$(shell echo "$${CFLAGS}") - LDFLAGS+= - --ifneq (,$(findstring DBG_MALLOC, $(DEFS))) -- CC_OPTIMIZE_FLAG?=-O0 --endif -- --ifeq ($(CC_NAME), gcc) -- CC_OPTIMIZE_FLAG?=-O9 --endif --ifeq ($(CC_NAME), icc) -- CC_OPTIMIZE_FLAG?=-O3 --endif --ifeq ($(CC_NAME), clang) -- CC_OPTIMIZE_FLAG?=-O3 --endif -- - ifeq (,$(CFLAGS)) - --#common stuff --CFLAGS+=$(DEBUGSYM) -- --# setting more CFLAGS --ifeq ($(mode), release) -- --#if i386 --ifeq ($(ARCH), i386) -- # These CPU optimization assumes that you run a Intel processor. -- # If you use a AMD CPU, you could ajust the settings here for better -- # performance. For gcc 4.x use CPU_TYPE ?= athlon-xp -- # if gcc --ifeq ($(CC_NAME), gcc) -- #common stuff -- CFLAGS+=-m32 $(CC_OPTIMIZE_FLAG) -funroll-loops -Wcast-align $(PROFILE) \ -- -Wall -- LDFLAGS+=-m32 -- #if gcc 4.0+ --ifeq ($(CC_CLASS), 4.x) -- ARCH_VER=$(shell $(GETARCH)) --ifeq ($(ARCH_VER), i386) -- CPU_TYPE ?= i686 --else -- CPU_TYPE ?= prescott --endif -- CFLAGS+=-minline-all-stringops \ -- -falign-loops \ -- -ftree-vectorize \ -- -mtune=$(CPU_TYPE) \ -- -Wold-style-definition -Wmissing-field-initializers -Wredundant-decls -- --else -- #if gcc 3.0+ --ifeq ($(CC_CLASS), 3.x) -- CPU_TYPE ?= pentium4 -- CFLAGS+=-minline-all-stringops \ -- -falign-loops --ifeq (X,$(shell echo "$(CC_SHORTVER)" | sed -e 's/3\.[0-3]/X/')) -- CFLAGS+=-mcpu=$(CPU_TYPE) --else -- CFLAGS+=-mtune=$(CPU_TYPE) --endif --else --ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) --$(warning Old gcc detected ($(CC_SHORTVER)), use gcc >= 3.1 \ -- for better results) -- -- CFLAGS+=-m486 \ -- -malign-loops=4 --else -- #really old version --$(warning You are using an old and unsupported gcc \ -- version ($(CC_SHORTVER)), compile at your own risk!) -- --endif # CC_CLASS, 2.9x --endif # CC_CLASS, 3.x --endif # CC_CLASS, 4.x -- --else # CC_NAME, gcc --ifeq ($(CC_NAME), icc) -- CFLAGS+=$(CC_OPTIMIZE_FLAG) -ipo -ipo_obj -unroll $(PROFILE) \ -- -tpp6 -xK #-openmp #optimize for PIII -- # -prefetch doesn't seem to work -- #( ty to inline acroos files, unroll loops,prefetch, -- # optimize for PIII, use PIII instructions & vect., -- # mutlithread loops) --else #CC_NAME, icc --ifeq ($(CC_NAME), suncc) -- CFLAGS+=-xO5 -fast -native -xCC \ -- -xc99=no_lib # C99 support -- # -Dinline="" # add this if cc < 5.3 (define inline as null) --else --ifeq ($(CC_NAME), clang) -- CFLAGS+=$(CC_OPTIMIZE_FLAG) -Wall -funroll-loops --else -- #other compilers --$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) --endif #CC_NAME, clang --endif #CC_NAME, suncc --endif #CC_NAME, icc --endif #CC_NAME, gcc --endif #ARCH, i386 -- --#x86_64 --ifeq ($(ARCH), x86_64) -- # These CPU optimization assumes that you run a Intel 64 processor. -- # If you use a AMD 64 CPU, you could ajust the settings here for better -- # performance. For gcc 4.x use CPU_TYPE ?= athlon64 -- # Perhaps it makes sense to use '-m64' here? -- # if gcc --ifeq ($(CC_NAME), gcc) -- #common stuff -- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops -Wcast-align $(PROFILE) \ -- -Wall -- #if gcc 4.0+ --ifeq ($(CC_CLASS), 4.x) -- CPU_TYPE ?= nocona -- CFLAGS+=-minline-all-stringops \ -- -falign-loops \ -- -ftree-vectorize \ -- -mtune=$(CPU_TYPE) \ -- -Wold-style-definition -Wmissing-field-initializers -Wredundant-decls --else -- #if gcc 3.0+ --ifeq ($(CC_CLASS), 3.x) -- CPU_TYPE ?= nocona -- CFLAGS+=-minline-all-stringops \ -- -falign-loops \ -- -mtune=$(CPU_TYPE) --else --ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) --$(warning Old gcc detected ($(CC_SHORTVER)), use gcc >= 3.1 \ -- for better results) -- -- CFLAGS+=-m486 \ -- -malign-loops=4 --else -- #really old version --$(warning You are using an old and unsupported gcc \ -- version ($(CC_SHORTVER)), compile at your own risk!) -- --endif # CC_CLASS, 2.9x --endif # CC_CLASS, 3.x --endif # CC_CLASS, 4.x -- --else # CC_NAME, gcc --ifeq ($(CC_NAME), icc) -- CFLAGS+=$(CC_OPTIMIZE_FLAG) -ipo -ipo_obj -unroll $(PROFILE) \ -- -tpp6 -xK #-openmp #optimize for PIII -- # -prefetch doesn't seem to work -- #( ty to inline acroos files, unroll loops,prefetch, -- # optimize for PIII, use PIII instructions & vect., -- # mutlithread loops) --else --ifeq ($(CC_NAME), suncc) -- CFLAGS+=-xO5 -fast -native -xCC \ -- -xc99=no_lib # C99 support -- # -Dinline="" # add this if cc < 5.3 (define inline as null) --else --ifeq ($(CC_NAME), clang) -- CFLAGS+=$(CC_OPTIMIZE_FLAG) -Wall -funroll-loops --else -- #other compilers --$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) --endif #CC_NAME, clang --endif #CC_NAME, icc --endif #CC_NAME, gcc --endif #CC_NAME, suncc --endif #ARCH, x86_64 -- -- #if sparc --ifeq ($(ARCH), sparc64) -- #if gcc --ifeq ($(CC_NAME), gcc) -- #common stuff -- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops $(PROFILE) \ -- -Wall\ -- #-Wcast-align \ -- #-Wmissing-prototypes -- #if gcc 4.x --ifeq ($(CC_CLASS), 4.x) -- -- # Processors of Family UltraSparc II -- ifeq ($(CHIP), ultrasparc-ii) -- CFLAGS+= -ftree-vectorize -mcpu=ultrasparc -mtune=ultrasparc -mvis -- endif -- -- # Processors of Family UltraSparc III (III, III, IIIi, IIICu) -- ifeq ($(CHIP), ultrasparc-iiii) -- CFLAGS+= -ftree-vectorize -mcpu=ultrasparc3 -mtune=ultrasparc3 -mvis -- endif -- -- ifeq ($(CHIP), ultrasparc-iii) -- CFLAGS+= -ftree-vectorize -mcpu=ultrasparc3 -mtune=ultrasparc3 -mvis -- endif -- -- ifeq ($(CHIP), ultrasparc-iiicu) -- CFLAGS+= -ftree-vectorize -mcpu=ultrasparc3 -mtune=ultrasparc3 -mvis -- endif -- -- # Processors of Family UltraSparc T1 -- ifeq ($(CHIP), ultrasparc-t1) -- # niagara switch is not supported on GCC < 4.2 -- # Sets to default ultrasparc -- ifeq ($(CC_SHORTVER), 4.2) -- CFLAGS+= -ftree-vectorize -mcpu=niagara -mtune=niagara -mvis -- else -- ifeq ($(CC_SHORTVER), 4.3) -- CFLAGS+= -ftree-vectorize -mcpu=niagara -mtune=niagara -mvis -- else -- CFLAGS+= -ftree-vectorize -mcpu=ultrasparc -mtune=ultrasparc -mvis -- endif -- endif -- endif -- -- # If processor detection fails, defaults to UltraSPARC without VIS -- ifeq (,$(CHIP)) -- #CPU_TYPE=ultrasparc -- CFLAGS += -mcpu=ultrasparc -mtune=ultrasparc -- endif -- -- # use -m64 to force 64 bit (but add it also to LDFLAGS), -- # -m32 for 32 bit (default on solaris), -- # nothing for arch. default -- # -mcpu=v9 or ultrasparc? # -mtune implied by -mcpu -- #-mno-epilogue #try to inline function exit code -- #-mflat # omit save/restore -- #-,faster-structs #faster non Sparc ABI structure copy ops -- --else -- #if gcc 3.0+ --ifeq ($(CC_CLASS), 3.x) -- -- # Processors of Family UltraSparc II -- ifeq ($(CHIP), ultrasparc-ii) -- #CPU_TYPE=ultrasparc -- CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc -mvis -- endif -- -- # Processors of Family UltraSparc III -- ifeq ($(CHIP), ultrasparc-iiii) -- CFLAGS+= -mcpu=ultrasparc3 -mtune=ultrasparc3 -mvis -- endif -- -- ifeq ($(CHIP), ultrasparc-iiii) -- CFLAGS+= -mcpu=ultrasparc3 -mtune=ultrasparc3 -mvis -- endif -- -- ifeq ($(CHIP), ultrasparc-iiicu) -- CFLAGS+= -mcpu=ultrasparc3 -mtune=ultrasparc3 -mvis -- endif -- -- # Processors of Family UltraSparc T1 -- ifeq ($(CHIP), ultrasparc-t1) -- # niagara switch is not supported on GCC < 4.2 -- # Sets to default ultrasparc -- CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc -mvis -- endif -- -- # If processor detection fails, defaults to UltraSPARC without VIS -- ifeq (,$(CHIP)) -- #CPU_TYPE=ultrasparc -- CFLAGS += -mcpu=ultrasparc -mtune=ultrasparc -- endif -- -- # use -m64 to force 64 bit (but add it also to LDFLAGS), -- # -m32 for 32 bit (default on solaris), -- # nothing for arch. default -- # -mcpu=v9 or ultrasparc? # -mtune implied by -mcpu -- #-mno-epilogue #try to inline function exit code -- #-mflat # omit save/restore -- #-,faster-structs #faster non Sparc ABI structure copy ops -- --else # CC_CLASS, 3.0 --ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) --$(warning Old gcc detected ($(CC_SHORTVER)), use gcc >= 3.1 \ -- for better results) --ifneq ($(OS), netbsd) -- # on netbsd/sparc64, gcc 2.95.3 does not compile -- # opensips with -mv8 -- CFLAGS+= -mv8 --endif --ifeq ($(ASTYPE), solaris) -- CFLAGS+= -Wa,-xarch=v8plus --endif --else #CC_CLASS, 2.9x -- #really old version --$(warning You are using an old and unsupported gcc \ -- version ($(CC_SHORTVER)), compile at your own risk!) -- -- CFLAGS+= -mv8 --ifeq ($(ASTYPE), solaris) -- CFLAGS+= -Wa,-xarch=v8plus --endif -- --endif #CC_CLASS, 2.9x --endif #CC_CLASS, 3.x --endif #CC_CLASS, 4.x -- --else #CC_NAME, gcc --ifeq ($(CC_NAME), suncc) -- CFLAGS+=-xO5 -fast -native -xarch=v8plusa -xCC \ -- -xc99=no_lib # C99 support -- # -Dinline="" # add this if cc < 5.3 (define inline as null) --else -- #other compilers --$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) --endif #CC_NAME, suncc --endif #CC_NAME, gcc --endif #ARCH, sparc64 -- -- #if ipaq/netwinder --ifeq ($(ARCH), arm) -- # if gcc --ifeq ($(CC_NAME), gcc) -- #common stuff -- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops -Wcast-align $(PROFILE) \ -- -Wall -marm -- #if gcc 4.x+ --ifeq ($(CC_CLASS), 4.x) -- CFLAGS+=-mcpu=strongarm1100 -ftree-vectorize --else -- #if gcc 3.0+ --ifeq ($(CC_CLASS), 3.x) -- CFLAGS+= -mcpu=strongarm1100 --else --ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) --$(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ -- for better results) -- -- CFLAGS+= --else -- #really old version --$(warning You are using an old and unsupported gcc \ -- version ($(CC_SHORTVER)), compile at your own risk!) -- --endif # CC_CLASS, 2.9x --endif # CC_CLASS, 3.x --endif # CC_CLASS, 4.x -- --else # CC_NAME, gcc -- #other compilers --$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) --endif #CC_NAME, gcc --endif #ARCH, arm -- -- #if mips (R3000) --ifeq ($(ARCH), mips) -- # if gcc --ifeq ($(CC_NAME), gcc) -- #common stuff -- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops -Wcast-align $(PROFILE) \ -- -Wall -- #if gcc 4.0+ --ifeq ($(CC_CLASS), 4.x) -- CFLAGS+=-mcpu=r3000 -minline-all-stringops \ -- -ftree-vectorize --else -- #if gcc 3.0+ --ifeq ($(CC_CLASS), 3.x) -- CFLAGS+= -mcpu=r3000 -- #-mcpu=athlon --else --ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) --$(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ -- for better results) -- -- CFLAGS+=-mcpu=r3000 --else -- #really old version --$(warning You are using an old and unsupported gcc \ -- version ($(CC_SHORTVER)), compile at your own risk!) -- --endif # CC_CLASS, 2.9x --endif # CC_CLASS, 3.x --endif # CC_CLASS, 4.x -- --else # CC_NAME, gcc -- #other compilers --$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) --endif #CC_NAME, gcc --endif #ARCH, mips -- -- #if >=mips2 (R4000, R5000, R6000 ....) --ifeq ($(ARCH), mips2) -- # if gcc --ifeq ($(CC_NAME), gcc) -- #common stuff -- CFLAGS+=$(CC_OPTIMIZE_FLAG) -mips2 -funroll-loops $(PROFILE) \ -- -Wall -- #if gcc 4.0+ --ifeq ($(CC_CLASS), 4.x) -- CFLAGS+=-minline-all-stringops -ftree-vectorize --else -- #if gcc 3.0+ --ifeq ($(CC_CLASS), 3.x) -- CFLAGS+= --else --ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) --$(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ -- for better results) -- CFLAGS+= --else -- #really old version --$(warning You are using an old and unsupported gcc \ -- version ($(CC_SHORTVER)), compile at your own risk!) -- --endif # CC_CLASS, 2.9x --endif # CC_CLASS, 3.x --endif # CC_CLASS, 4.x -- --else # CC_NAME, gcc -- #other compilers --$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) --endif #CC_NAME, gcc --endif #ARCH, mips2 -- --#if alpha --ifeq ($(ARCH), alpha) -- # if gcc --ifeq ($(CC_NAME), gcc) -- #common stuff -- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops $(PROFILE) -Wall -- #if gcc 4.0+ --ifeq ($(CC_CLASS), 4.x) -- CFLAGS+=-minline-all-stringops --else -- #if gcc 3.0+ --ifeq ($(CC_CLASS), 3.x) -- CFLAGS+= --else --ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) --$(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ -- for better results) -- CFLAGS+= --else -- #really old version --$(warning You are using an old and unsupported gcc \ -- version ($(CC_SHORTVER)), compile at your own risk!) -- --endif # CC_CLASS, 2.9x --endif # CC_CLASS, 3.x --endif # CC_CLASS, 4.x -- --else # CC_NAME, gcc -- #other compilers --$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) --endif #CC_NAME, gcc --endif #ARCH, alpha -- --#if ppc --ifeq ($(ARCH), ppc) -- # if gcc --ifeq ($(CC_NAME), gcc) -- #common stuff -- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops $(PROFILE) -Wall -- #if gcc 4.0+ --ifeq ($(CC_CLASS), 4.x) -- CPU_TYPE ?= powerpc -- CFLAGS+=-ftree-vectorize \ -- -mtune=$(CPU_TYPE) -maltivec --else -- #if gcc 3.0+ --ifeq ($(CC_CLASS), 3.x) -- CFLAGS+= --else --ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) --$(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ -- for better results) -- CFLAGS+= --else -- #really old version --$(warning You are using an old and unsupported gcc \ -- version ($(CC_SHORTVER)), compile at your own risk!) -- --endif # CC_CLASS, 2.9x --endif # CC_CLASS, 3.x --endif # CC_CLASS, 4.x -- --else # CC_NAME, gcc -- #other compilers --$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) --endif #CC_NAME, gcc --endif #ARCH, ppc -- --#if ppc64 --ifeq ($(ARCH), ppc64) -- # if gcc --ifeq ($(CC_NAME), gcc) -- #common stuff -- CFLAGS+=$(CC_OPTIMIZE_FLAG) -funroll-loops $(PROFILE) -Wall --ifeq ($(CC_CLASS), 4.x) -- CPU_TYPE ?= powerpc64 -- CFLAGS+=-ftree-vectorize \ -- -mtune=$(CPU_TYPE) -maltivec --else -- #if gcc 3.0+ --ifeq ($(CC_CLASS), 3.x) -- CFLAGS+= --else --ifeq ($(CC_CLASS), 2.9x) #older gcc version (2.9[1-5]) --$(warning Old gcc detected ($(CC_SHORTVER)), use gcc 3.0.x \ -- for better results) -- CFLAGS+= --else -- #really old version --$(warning You are using an old and unsupported gcc \ -- version ($(CC_SHORTVER)), compile at your own risk!) -- --endif # CC_CLASS, 2.9x --endif # CC_CLASS, 3.x --endif # CC_CLASS, 4.x -- --else # CC_NAME, gcc -- #other compilers --$(error Unsupported compiler ($(CC):$(CC_NAME)), try gcc) --endif #CC_NAME, gcc --endif #ARCH, ppc -- --endif # CFLAGS not set -- --CFLAGS+= $(CC_EXTRA_OPTS) -- - LD_EXTRA_OPTS ?= - - # setting LDFLAGS diff --git a/opensips-0009-Explicitly-use-Python2.patch b/opensips-0009-Explicitly-use-Python2.patch deleted file mode 100644 index 1b5dd5f..0000000 --- a/opensips-0009-Explicitly-use-Python2.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Peter Lemenkov -Date: Thu, 20 Sep 2018 13:17:07 +0300 -Subject: [PATCH] Explicitly use Python2 - -Signed-off-by: Peter Lemenkov - -diff --git a/scripts/dbtextdb/__init__.py b/scripts/dbtextdb/__init__.py -index 1041be860..3d3bfde22 100644 ---- a/scripts/dbtextdb/__init__.py -+++ b/scripts/dbtextdb/__init__.py -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/python2 - # - # Copyright 2008 Google Inc. All Rights Reserved. - -diff --git a/scripts/dbtextdb/dbtextdb.py b/scripts/dbtextdb/dbtextdb.py -index 3cd866f02..98038820b 100755 ---- a/scripts/dbtextdb/dbtextdb.py -+++ b/scripts/dbtextdb/dbtextdb.py -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/python2 - # - # Copyright 2008 Google Inc. All Rights Reserved. - -diff --git a/scripts/dbtextdb/dbtextdb_test.py b/scripts/dbtextdb/dbtextdb_test.py -index ecbab0674..ecdff6851 100644 ---- a/scripts/dbtextdb/dbtextdb_test.py -+++ b/scripts/dbtextdb/dbtextdb_test.py -@@ -1,4 +1,4 @@ --#!/usr/bin/python -+#!/usr/bin/python2 - # - # Copyright 2008 Google Inc. All Rights Reserved. - diff --git a/opensips.spec b/opensips.spec index 8e9a3ae..08e19f6 100644 --- a/opensips.spec +++ b/opensips.spec @@ -4,20 +4,18 @@ Summary: Open Source SIP Server Name: opensips -Version: 2.4.5 -Release: 2%{?dist} +Version: 2.4.6 +Release: 1%{?dist} License: GPLv2+ Source0: https://github.com/%{name}/%{name}/archive/%{version}/%{name}-%{version}.tar.gz # Fedora-specific patches Patch1: opensips-0001-Consistently-use-rtpproxy-switches.patch Patch2: opensips-0002-Cleanup-Oracle-s-makefiles.patch -Patch3: opensips-0003-Removed-all-async-Oracle-operations-they-didn-t-work.patch -Patch4: opensips-0004-db_oracle-Fix-default-ret-result.patch -Patch5: opensips-0005-Return-actual-payload-ID-in-case-of-a-dynamic-payloa.patch -Patch6: opensips-0006-Use-additional-auth-field-Sip-Source-IP-Address.patch -Patch7: opensips-0007-Don-t-remove-pthread-library-explicitly-from-mi_xmlr.patch -Patch8: opensips-0008-Dont-try-modifying-CFLAGS.patch -Patch9: opensips-0009-Explicitly-use-Python2.patch +Patch3: opensips-0003-db_ora-null-terminating-string-is-more-safely-most-m.patch +Patch4: opensips-0004-Return-actual-payload-ID-in-case-of-a-dynamic-payloa.patch +Patch5: opensips-0005-Use-additional-auth-field-Sip-Source-IP-Address.patch +Patch6: opensips-0006-Don-t-remove-pthread-library-explicitly-from-mi_xmlr.patch +Patch7: opensips-0007-Dont-try-modifying-CFLAGS.patch # Backported from 2.4 branch # none @@ -1373,6 +1371,9 @@ useradd -r -g %{name} -d %{_localstatedir}/run/%{name} -s /sbin/nologin \ %changelog +* Thu Jun 13 2019 Peter Lemenkov - 2.4.6-1 +- Ver. 2.4.6 + * Fri May 31 2019 Jitka Plesnikova - 2.4.5-2 - Perl 5.30 rebuild diff --git a/sources b/sources index 18bd5f8..559a578 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (opensips-2.4.5.tar.gz) = 77ba1d977022f4b7679694ea484b51dbfcb880a65748742a6ea0ced9fe8dc0a8bfe6f7715992d51087609dda5670f02578c10b17beaf2ca693fd347e8117939d +SHA512 (opensips-2.4.6.tar.gz) = ec757513a5df8dc4ee788861d4d61409fd69e8f89c513a9d2a2173839b24fa89b28a9d5c1dfe591b727ecd212f8f9797294c7e51ccc03eb4104cf1c2eaeb6930