From f4a47e30c72fb43cfad9e0f9dbf415c127176cbc Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Mon, 6 Nov 2017 13:02:36 +0000 Subject: [PATCH] support relative path of freeDiameter --- debian/rules | 4 ++-- lib/core/src/unix/net_lib.c | 18 +++++++++++++++--- support/config/hss.conf.in | 2 +- support/config/mme.conf.in | 2 +- support/config/nextepc.conf.in | 8 ++++---- support/config/pcrf.conf.in | 2 +- support/config/pgw.conf.in | 2 +- support/freeDiameter/hss.conf.in | 16 ++++++++-------- support/freeDiameter/mme.conf.in | 16 ++++++++-------- support/freeDiameter/pcrf.conf.in | 14 +++++++------- support/freeDiameter/pgw.conf.in | 14 +++++++------- 11 files changed, 55 insertions(+), 43 deletions(-) diff --git a/debian/rules b/debian/rules index 445be76f1..8d0fb6a98 100755 --- a/debian/rules +++ b/debian/rules @@ -29,9 +29,9 @@ override_dh_auto_test: mongodb_exclude_list="-x s1setup_test attach_test volte_test handover_test"; \ fi; \ mkdir -p debian/test/db debian/test/etc/nextepc/freeDiameter debian/test/var/log/nextepc; \ - sed -e 's?@SYSCONF_DIR@?'`pwd`'/debian/test/etc?g;s?@LOCALSTATE_DIR@?'`pwd`'/debian/test/var?g;'$$remove_db_uri_conf'' support/config/nextepc.conf.in > debian/test/etc/nextepc/nextepc.conf; \ + sed -e 's?\([_a-z0-9]*\)\.conf?'`pwd`'/debian/test/etc/nextepc/freeDiameter/\1.conf?g;s?@LOCALSTATE_DIR@?'`pwd`'/debian/test/var?g;'$$remove_db_uri_conf'' support/config/nextepc.conf.in > debian/test/etc/nextepc/nextepc.conf; \ for i in `find support/freeDiameter -name '*.conf.in' -printf "%f\n" | sed 's/.in$$//g'`; do \ - sed 's?@SYSCONF_DIR@/nextepc?'`pwd`'/support?g;s?@LIB_DIR@/nextepc/freeDiameter/\([_a-z0-9]*\)\.so?'`pwd`'/lib/freeDiameter-1.2.1/extensions/\1/.libs/\1.so?g' support/freeDiameter/$$i.in > debian/test/etc/nextepc/freeDiameter/$$i; \ + sed 's?@SYSCONF_DIR@/nextepc?'`pwd`'/support?g;s?\([_a-z0-9]*\)\.so?'`pwd`'/lib/freeDiameter-1.2.1/extensions/\1/.libs/\1.so?g' support/freeDiameter/$$i.in > debian/test/etc/nextepc/freeDiameter/$$i; \ done; \ if ! cat /proc/net/protocols | grep SCTP > /dev/null; then \ sctp_exclude_list="-x testsctp s1setup_test attach_test volte_test handover_test"; \ diff --git a/lib/core/src/unix/net_lib.c b/lib/core/src/unix/net_lib.c index 1697305d9..c1dc0e138 100644 --- a/lib/core/src/unix/net_lib.c +++ b/lib/core/src/unix/net_lib.c @@ -1550,7 +1550,11 @@ int net_link_promisc(net_link_t *net_link, int enable) /** Close network interface */ int net_link_close(net_link_t *net_link) { - d_assert(net_link,return -1, "net_link is NULL\n"); + if (!net_link) + { + d_error("net_link is NULL"); + return -1; + } /* Disable promisc mode if enabled */ net_link_promisc(net_link, 0); close(net_link->fd); @@ -1562,7 +1566,11 @@ int net_link_close(net_link_t *net_link) /** Close network interface */ int net_raw_close(net_link_t *net_link) { - d_assert(net_link,return -1, "net_link is NULL\n"); + if (!net_link) + { + d_error("net_link is NULL"); + return -1; + } close(net_link->fd); pool_free_node(&link_pool, net_link); return 0; @@ -1570,7 +1578,11 @@ int net_raw_close(net_link_t *net_link) int net_tun_close(net_link_t *net_link) { - d_assert(net_link,return -1, "net_link is NULL\n"); + if (!net_link) + { + d_error("net_link is NULL"); + return -1; + } close(net_link->fd); pool_free_node(&link_pool, net_link); return 0; diff --git a/support/config/hss.conf.in b/support/config/hss.conf.in index 267e1e72c..aedc40cd9 100644 --- a/support/config/hss.conf.in +++ b/support/config/hss.conf.in @@ -17,7 +17,7 @@ "HSS" : { - "FD_CONF_PATH" : "@SYSCONF_DIR@/nextepc/freeDiameter/hss.conf" + "FD_CONF_PATH" : "hss.conf" } } diff --git a/support/config/mme.conf.in b/support/config/mme.conf.in index c4a0ea7fa..6a5fa1b0a 100644 --- a/support/config/mme.conf.in +++ b/support/config/mme.conf.in @@ -19,7 +19,7 @@ "MME" : { - "FD_CONF_PATH" : "@SYSCONF_DIR@/nextepc/freeDiameter/mme.conf", + "FD_CONF_PATH" : "mme.conf", "DEFAULT_PAGING_DRX" : "v64", "NETWORK" : { diff --git a/support/config/nextepc.conf.in b/support/config/nextepc.conf.in index 234da864d..96ad305e2 100644 --- a/support/config/nextepc.conf.in +++ b/support/config/nextepc.conf.in @@ -27,7 +27,7 @@ "MME" : { - "FD_CONF_PATH" : "@SYSCONF_DIR@/nextepc/freeDiameter/mme.conf", + "FD_CONF_PATH" : "mme.conf", "DEFAULT_PAGING_DRX" : "v64", "NETWORK" : { @@ -66,7 +66,7 @@ "HSS" : { - "FD_CONF_PATH" : "@SYSCONF_DIR@/nextepc/freeDiameter/hss.conf" + "FD_CONF_PATH" : "hss.conf" }, "SGW" : @@ -82,7 +82,7 @@ "PGW" : { - "FD_CONF_PATH" : "@SYSCONF_DIR@/nextepc/freeDiameter/pgw.conf", + "FD_CONF_PATH" : "pgw.conf", "NETWORK" : { "GTPC_IPV4" : "127.76.0.3", @@ -104,7 +104,7 @@ "PCRF" : { - "FD_CONF_PATH" : "@SYSCONF_DIR@/nextepc/freeDiameter/pcrf.conf" + "FD_CONF_PATH" : "pcrf.conf" } } diff --git a/support/config/pcrf.conf.in b/support/config/pcrf.conf.in index e179cd623..9e3738496 100644 --- a/support/config/pcrf.conf.in +++ b/support/config/pcrf.conf.in @@ -16,7 +16,7 @@ }, "PCRF" : { - "FD_CONF_PATH" : "@SYSCONF_DIR@/nextepc/freeDiameter/pcrf.conf" + "FD_CONF_PATH" : "pcrf.conf" } } diff --git a/support/config/pgw.conf.in b/support/config/pgw.conf.in index ab337ebab..01a5cf525 100644 --- a/support/config/pgw.conf.in +++ b/support/config/pgw.conf.in @@ -17,7 +17,7 @@ "PGW" : { - "FD_CONF_PATH" : "@SYSCONF_DIR@/nextepc/freeDiameter/pgw.conf", + "FD_CONF_PATH" : "pgw.conf", "NETWORK" : { "GTPC_IPV4" : "127.76.0.3", diff --git a/support/freeDiameter/hss.conf.in b/support/freeDiameter/hss.conf.in index c5c9aef37..fd43d1a95 100644 --- a/support/freeDiameter/hss.conf.in +++ b/support/freeDiameter/hss.conf.in @@ -223,14 +223,14 @@ TLS_CA = "@SYSCONF_DIR@/nextepc/freeDiameter/cacert.pem"; # 4 - full - display the complete information on a single long line # 8 - tree - display the complete information in an easier to read format spanning several lines. -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dbg_msg_dumps.so" : "0x8888"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_rfc5777.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_mip6i.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_nasreq.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_nas_mipv6.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_dcca.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_dcca_3gpp.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_s6a.so"; +LoadExtension = "dbg_msg_dumps.so" : "0x8888"; +LoadExtension = "dict_rfc5777.so"; +LoadExtension = "dict_mip6i.so"; +LoadExtension = "dict_nasreq.so"; +LoadExtension = "dict_nas_mipv6.so"; +LoadExtension = "dict_dcca.so"; +LoadExtension = "dict_dcca_3gpp.so"; +LoadExtension = "dict_s6a.so"; ############################################################## diff --git a/support/freeDiameter/mme.conf.in b/support/freeDiameter/mme.conf.in index 0bb5367ca..bdfe85aaf 100644 --- a/support/freeDiameter/mme.conf.in +++ b/support/freeDiameter/mme.conf.in @@ -223,14 +223,14 @@ TLS_CA = "@SYSCONF_DIR@/nextepc/freeDiameter/cacert.pem"; # 4 - full - display the complete information on a single long line # 8 - tree - display the complete information in an easier to read format spanning several lines. -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dbg_msg_dumps.so" : "0x8888"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_rfc5777.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_mip6i.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_nasreq.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_nas_mipv6.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_dcca.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_dcca_3gpp.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_s6a.so"; +LoadExtension = "dbg_msg_dumps.so" : "0x8888"; +LoadExtension = "dict_rfc5777.so"; +LoadExtension = "dict_mip6i.so"; +LoadExtension = "dict_nasreq.so"; +LoadExtension = "dict_nas_mipv6.so"; +LoadExtension = "dict_dcca.so"; +LoadExtension = "dict_dcca_3gpp.so"; +LoadExtension = "dict_s6a.so"; ############################################################## diff --git a/support/freeDiameter/pcrf.conf.in b/support/freeDiameter/pcrf.conf.in index 2ddfe3acc..84fe31c94 100644 --- a/support/freeDiameter/pcrf.conf.in +++ b/support/freeDiameter/pcrf.conf.in @@ -223,13 +223,13 @@ TLS_CA = "@SYSCONF_DIR@/nextepc/freeDiameter/cacert.pem"; # 4 - full - display the complete information on a single long line # 8 - tree - display the complete information in an easier to read format spanning several lines. -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dbg_msg_dumps.so" : "0x8888"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_rfc5777.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_mip6i.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_nasreq.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_nas_mipv6.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_dcca.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_dcca_3gpp.so"; +LoadExtension = "dbg_msg_dumps.so" : "0x8888"; +LoadExtension = "dict_rfc5777.so"; +LoadExtension = "dict_mip6i.so"; +LoadExtension = "dict_nasreq.so"; +LoadExtension = "dict_nas_mipv6.so"; +LoadExtension = "dict_dcca.so"; +LoadExtension = "dict_dcca_3gpp.so"; ############################################################## diff --git a/support/freeDiameter/pgw.conf.in b/support/freeDiameter/pgw.conf.in index 825efe298..22a007d77 100644 --- a/support/freeDiameter/pgw.conf.in +++ b/support/freeDiameter/pgw.conf.in @@ -223,13 +223,13 @@ TLS_CA = "@SYSCONF_DIR@/nextepc/freeDiameter/cacert.pem"; # 4 - full - display the complete information on a single long line # 8 - tree - display the complete information in an easier to read format spanning several lines. -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dbg_msg_dumps.so" : "0x8888"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_rfc5777.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_mip6i.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_nasreq.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_nas_mipv6.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_dcca.so"; -LoadExtension = "@LIB_DIR@/nextepc/freeDiameter/dict_dcca_3gpp.so"; +LoadExtension = "dbg_msg_dumps.so" : "0x8888"; +LoadExtension = "dict_rfc5777.so"; +LoadExtension = "dict_mip6i.so"; +LoadExtension = "dict_nasreq.so"; +LoadExtension = "dict_nas_mipv6.so"; +LoadExtension = "dict_dcca.so"; +LoadExtension = "dict_dcca_3gpp.so"; ##############################################################