Module: kamailio Branch: master Commit: fcc4da4df955245d1b3ecafaa9daf9e12cc268f1 URL: https://github.com/kamailio/kamailio/commit/fcc4da4df955245d1b3ecafaa9daf9e12cc268f1
Author: Daniel-Constantin Mierla <[email protected]> Committer: Daniel-Constantin Mierla <[email protected]> Date: 2025-10-30T11:24:51+01:00 rr: remove long time unused -DENABLE_USER_CHECK - unclear if code was actually working after many years disabled --- Modified: src/modules/rr/Makefile Modified: src/modules/rr/loose.c Modified: src/modules/rr/record.c Modified: src/modules/rr/rr_mod.c Modified: src/modules/rr/rr_mod.h --- Diff: https://github.com/kamailio/kamailio/commit/fcc4da4df955245d1b3ecafaa9daf9e12cc268f1.diff Patch: https://github.com/kamailio/kamailio/commit/fcc4da4df955245d1b3ecafaa9daf9e12cc268f1.patch --- diff --git a/src/modules/rr/Makefile b/src/modules/rr/Makefile index 04d50cc0143..5af64eef686 100644 --- a/src/modules/rr/Makefile +++ b/src/modules/rr/Makefile @@ -1,7 +1,7 @@ # # rr module makefile # -# +# # WARNING: do not run this directly, it should be run by the main Makefile include ../../Makefile.defs @@ -9,6 +9,4 @@ auto_gen= NAME=rr.so LIBS= -#DEFS+=-DENABLE_USER_CHECK - include ../../Makefile.modules diff --git a/src/modules/rr/loose.c b/src/modules/rr/loose.c index 443f90b17f4..232b5931234 100644 --- a/src/modules/rr/loose.c +++ b/src/modules/rr/loose.c @@ -133,14 +133,6 @@ static inline int is_myself(sip_uri_t *_puri) if(ret < 0) return 0; -#ifdef ENABLE_USER_CHECK - if(ret == 1 && i_user.len && i_user.len == _puri->user.len - && strncmp(i_user.s, _puri->user.s, _puri->user.len) == 0) { - LM_DBG("ignore user matched - URI is not to the server itself\n"); - return 0; - } -#endif - if(ret == 1) { /* match on host:port, but if gruu, then fail */ if(_puri->gr.s != NULL) @@ -968,11 +960,6 @@ static inline int after_loose(struct sip_msg *_m, int _mode, int preloaded) } _m->msg_flags |= FL_ROUTE_ADDR; } else { -#ifdef ENABLE_USER_CHECK - /* check if it the ignored user */ - if(uri_is_myself < 0) - return RR_NOT_DRIVEN; -#endif LM_DBG("Topmost URI is NOT myself\n"); routed_params.s = NULL; routed_params.len = 0; diff --git a/src/modules/rr/record.c b/src/modules/rr/record.c index 9436d942104..d2762b060d5 100644 --- a/src/modules/rr/record.c +++ b/src/modules/rr/record.c @@ -253,16 +253,6 @@ static inline int build_rr(struct lump *_l, struct lump *_l2, str *user, memcpy(prefix, rr_prefix, rr_prefix_len); if(user->len) { memcpy(prefix + rr_prefix_len, user->s, user->len); -#ifdef ENABLE_USER_CHECK - /* don't add the ignored user into a RR */ - if(i_user.len && i_user.len == user->len - && !strncmp(i_user.s, user->s, i_user.len)) { - if(prefix[rr_prefix_len] == 'x') - prefix[rr_prefix_len] = 'y'; - else - prefix[rr_prefix_len] = 'x'; - } -#endif prefix[rr_prefix_len + user->len] = '@'; } diff --git a/src/modules/rr/rr_mod.c b/src/modules/rr/rr_mod.c index 5d4423b240e..8639249a15f 100644 --- a/src/modules/rr/rr_mod.c +++ b/src/modules/rr/rr_mod.c @@ -49,12 +49,6 @@ #include "rr_cb.h" #include "api.h" -#ifdef ENABLE_USER_CHECK -#include <string.h> -#include "../../core/str.h" -str i_user = {0, 0}; -#endif - int append_fromtag = 1; /*!< append from tag by default */ int enable_double_rr = 1; /*!< enable using of 2 RR by default */ int enable_full_lr = 0; /*!< compatibilty mode disabled by default */ @@ -135,9 +129,6 @@ static param_export_t params[] = { {"append_fromtag", PARAM_INT, &append_fromtag}, {"enable_double_rr", PARAM_INT, &enable_double_rr}, {"enable_full_lr", PARAM_INT, &enable_full_lr}, -#ifdef ENABLE_USER_CHECK - {"ignore_user", PARAM_STR, &i_user}, -#endif {"add_username", PARAM_INT, &add_username}, {"enable_socket_mismatch_warning", PARAM_INT, &enable_socket_mismatch_warning}, @@ -186,13 +177,6 @@ static int mod_init(void) memset(&rr_obb, 0, sizeof(ob_api_t)); } -#ifdef ENABLE_USER_CHECK - if(i_user.s && rr_obb.use_outbound) { - LM_ERR("cannot use \"ignore_user\" with outbound\n"); - return -1; - } -#endif - if(add_username != 0 && rr_obb.use_outbound) { LM_ERR("cannot use \"add_username\" with outbound\n"); return -1; diff --git a/src/modules/rr/rr_mod.h b/src/modules/rr/rr_mod.h index a411625824c..e5ec355c655 100644 --- a/src/modules/rr/rr_mod.h +++ b/src/modules/rr/rr_mod.h @@ -31,11 +31,6 @@ #include "../outbound/api.h" -#ifdef ENABLE_USER_CHECK -#include "../../core/str.h" -extern str i_user; -#endif - /*! bit to force loose mode in loose_route_mode() */ #define RR_LR_MODE_LOOSE_ONLY 1 /*! bit to skip outbound processing in after_loose() */ _______________________________________________ Kamailio - Development Mailing List -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!
