From e8034c181f5c5536409a7ceaee64d31be7786242 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Mon, 5 Nov 2018 22:46:20 +0100 Subject: [PATCH] kamailio-5.x: update to 5.1.6 Minor version bump. Two CVE patches can be removed as they're already included in the source. One patch was refreshed. Also: - https://sources.openwrt.org is added as primary source URL to lessen the load on kamailio upstream - Build/Configure is defined as empty (because there is no configure script in the source tree - patch is added to fix dp_replace(); the function was first added in the 5.1 release and didn't work; patch was accepted upstream Signed-off-by: Sebastian Kemper --- net/kamailio-5.x/Makefile | 13 ++++-- .../patches/140-CVE-2018-14767.patch | 28 ----------- .../patches/141-CVE-2018-16657.patch | 46 ------------------- .../patches/150-posix-awk-filter.patch | 4 +- ...ix_dp_replace_in_cmd_export_t_struct.patch | 30 ++++++++++++ 5 files changed, 40 insertions(+), 81 deletions(-) delete mode 100644 net/kamailio-5.x/patches/140-CVE-2018-14767.patch delete mode 100644 net/kamailio-5.x/patches/141-CVE-2018-16657.patch create mode 100644 net/kamailio-5.x/patches/160-dialplan-fix_dp_replace_in_cmd_export_t_struct.patch diff --git a/net/kamailio-5.x/Makefile b/net/kamailio-5.x/Makefile index c95965f..8edaf84 100644 --- a/net/kamailio-5.x/Makefile +++ b/net/kamailio-5.x/Makefile @@ -9,12 +9,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=kamailio5 -PKG_VERSION:=5.1.3 -PKG_RELEASE:=4 +PKG_VERSION:=5.1.6 +PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://www.kamailio.org/pub/kamailio/$(PKG_VERSION)/src +PKG_SOURCE_URL := \ + https://sources.openwrt.org \ + https://www.kamailio.org/pub/kamailio/$(PKG_VERSION)/src PKG_SOURCE:=kamailio-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz -PKG_HASH:=b2266e15ec8ffa62be66b44989155f26a31d137f06f81fb3841aad8315315a14 +PKG_HASH:=99880df20dd836e4d9ec03fe863f7a5fc77bb29e3d56f59ea92b8b986deb5186 PKG_USE_MIPS16:=0 PKG_LICENSE:=GPL-2.0+ @@ -424,6 +426,9 @@ PKG_MAKE_ARGS:= \ DESTDIR=$(PKG_INSTALL_DIR) \ quiet=verbose +define Build/Configure +endef + define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR) $(PKG_MAKE_ARGS) cfg $(MAKE) -C $(PKG_BUILD_DIR) quiet=verbose all diff --git a/net/kamailio-5.x/patches/140-CVE-2018-14767.patch b/net/kamailio-5.x/patches/140-CVE-2018-14767.patch deleted file mode 100644 index 801353f..0000000 --- a/net/kamailio-5.x/patches/140-CVE-2018-14767.patch +++ /dev/null @@ -1,28 +0,0 @@ -commit 281a6c6b6eaaf30058b603325e8ded20b99e1456 -Author: Henning Westerholt -Date: Mon May 7 09:36:53 2018 +0200 - - core: improve to header check guards, str consists of length and pointer - -diff --git a/src/core/msg_translator.c b/src/core/msg_translator.c -index 22122768a..4dd648e87 100644 ---- a/src/core/msg_translator.c -+++ b/src/core/msg_translator.c -@@ -2369,7 +2369,7 @@ char * build_res_buf_from_sip_req( unsigned int code, str *text ,str *new_tag, - case HDR_TO_T: - if (new_tag && new_tag->len) { - to_tag=get_to(msg)->tag_value; -- if ( to_tag.len || to_tag.s ) -+ if ( to_tag.len && to_tag.s ) - len+=new_tag->len-to_tag.len; - else - len+=new_tag->len+TOTAG_TOKEN_LEN/*";tag="*/; -@@ -2497,7 +2497,7 @@ char * build_res_buf_from_sip_req( unsigned int code, str *text ,str *new_tag, - break; - case HDR_TO_T: - if (new_tag && new_tag->len){ -- if (to_tag.s ) { /* replacement */ -+ if (to_tag.len && to_tag.s) { /* replacement */ - /* before to-tag */ - append_str( p, hdr->name.s, to_tag.s-hdr->name.s); - /* to tag replacement */ diff --git a/net/kamailio-5.x/patches/141-CVE-2018-16657.patch b/net/kamailio-5.x/patches/141-CVE-2018-16657.patch deleted file mode 100644 index 45346e9..0000000 --- a/net/kamailio-5.x/patches/141-CVE-2018-16657.patch +++ /dev/null @@ -1,46 +0,0 @@ -commit d67b2f9874ca23bd69f18df71b8f53b1b6151f6d -Author: Henning Westerholt -Date: Sun Jun 3 20:59:32 2018 +0200 - - core: improve header safe guards for Via handling - - (cherry picked from commit ad68e402ece8089f133c10de6ce319f9e28c0692) - -diff --git a/src/core/crc.c b/src/core/crc.c -index 462846324..23b2876ec 100644 ---- a/src/core/crc.c -+++ b/src/core/crc.c -@@ -231,6 +231,8 @@ void crcitt_string_array( char *dst, str src[], int size ) - ccitt = 0xFFFF; - str_len=CRC16_LEN; - for (i=0; is[name->len-1]==']')&& - (strncasecmp(name->s+1, s, len)==0)) - ) -- ) -+ ) { - return 0; -- else -- -+ } -+ else { -+ if (unlikely(name->s==NULL)) { -+ LM_CRIT("invalid Via host name\n"); -+ return -1; -+ } - if (strncmp(name->s, s, name->len)==0) - return 0; -+ } - }else{ - LM_CRIT("could not convert ip address\n"); - return -1; diff --git a/net/kamailio-5.x/patches/150-posix-awk-filter.patch b/net/kamailio-5.x/patches/150-posix-awk-filter.patch index 4fe4e40..e569191 100644 --- a/net/kamailio-5.x/patches/150-posix-awk-filter.patch +++ b/net/kamailio-5.x/patches/150-posix-awk-filter.patch @@ -17,11 +17,9 @@ Date: Sun Oct 7 18:54:39 2018 +0200 Signed-off-by: Sebastian Kemper -diff --git a/utils/kamctl/kamctl.base b/utils/kamctl/kamctl.base -index adeceb77f..a776e10d8 100644 --- a/utils/kamctl/kamctl.base +++ b/utils/kamctl/kamctl.base -@@ -715,7 +715,7 @@ filter_json() +@@ -699,7 +699,7 @@ filter_json() $AWK 'function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s } BEGIN { line=0; IGNORECASE=1; } { line++; } diff --git a/net/kamailio-5.x/patches/160-dialplan-fix_dp_replace_in_cmd_export_t_struct.patch b/net/kamailio-5.x/patches/160-dialplan-fix_dp_replace_in_cmd_export_t_struct.patch new file mode 100644 index 0000000..304b9c4 --- /dev/null +++ b/net/kamailio-5.x/patches/160-dialplan-fix_dp_replace_in_cmd_export_t_struct.patch @@ -0,0 +1,30 @@ +commit cbff35909edccffe778d04f3871d880195d82b7a +Author: Sebastian Kemper +Date: Fri Nov 2 10:10:38 2018 +0100 + + dialplan: fix dp_replace() in cmd_export_t struct + + In the struct 'int param_no' is set to '2'. But dp_replace() has actually three + parameters (dpid, inval, outvar), so kamailio's cfg parser fails when + dp_replace() is called: + + yyparse(): cfg. parser: failed to find command dp_replace (params 3) + yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 366, column 45: unknown command, missing loadmodule? + + This commit fixes 'int param_no' to address this. + + Signed-off-by: Sebastian Kemper + +diff --git a/src/modules/dialplan/dialplan.c b/src/modules/dialplan/dialplan.c +index 39ba1ceef..a96b246b7 100644 +--- a/src/modules/dialplan/dialplan.c ++++ b/src/modules/dialplan/dialplan.c +@@ -115,7 +115,7 @@ static cmd_export_t cmds[]={ + ANY_ROUTE}, + {"dp_match",(cmd_function)w_dp_match, 2, fixup_igp_spve, + fixup_free_igp_spve, ANY_ROUTE}, +- {"dp_replace",(cmd_function)w_dp_replace, 2, dp_replace_fixup, ++ {"dp_replace",(cmd_function)w_dp_replace, 3, dp_replace_fixup, + dp_replace_fixup_free, ANY_ROUTE}, + {0,0,0,0,0,0} + }; -- 2.30.2