Module: kamailio
Branch: master
Commit: 072c44330297c653675b5078fb0facdc399a5ab4
URL:
https://github.com/kamailio/kamailio/commit/072c44330297c653675b5078fb0facd…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-07-30T09:07:36+02:00
corex: switch to unsigned long long for iflag lookup
---
Modified: src/modules/corex/corex_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/072c44330297c653675b5078fb0facd…
Patch:
https://github.com/kamailio/kamailio/commit/072c44330297c653675b5078fb0facd…
---
diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c
index f055af88c8d..e853032cd7f 100644
--- a/src/modules/corex/corex_mod.c
+++ b/src/modules/corex/corex_mod.c
@@ -584,7 +584,7 @@ static msg_iflag_name_t _msg_iflag_list[] = {
/**
*
*/
-static int msg_lookup_flag(str *fname)
+static unsigned long long msg_lookup_flag(str *fname)
{
int i;
for(i = 0; _msg_iflag_list[i].name.len > 0; i++) {
@@ -594,21 +594,22 @@ static int msg_lookup_flag(str *fname)
return _msg_iflag_list[i].value;
}
}
- return -1;
+ return 0;
}
+
/**
*
*/
static int w_msg_iflag_set(sip_msg_t *msg, char *pflag, char *p2)
{
- int fv;
+ unsigned long long fv;
str fname;
if(fixup_get_svalue(msg, (gparam_t *)pflag, &fname)) {
LM_ERR("cannot get the msg flag name parameter\n");
return -1;
}
fv = msg_lookup_flag(&fname);
- if(fv == -1) {
+ if(fv == 0) {
LM_ERR("unsupported flag name [%.*s]\n", fname.len, fname.s);
return -1;
}
@@ -621,14 +622,14 @@ static int w_msg_iflag_set(sip_msg_t *msg, char *pflag, char *p2)
*/
static int w_msg_iflag_reset(sip_msg_t *msg, char *pflag, char *p2)
{
- int fv;
+ unsigned long long fv;
str fname;
if(fixup_get_svalue(msg, (gparam_t *)pflag, &fname)) {
LM_ERR("cannot get the msg flag name parameter\n");
return -1;
}
fv = msg_lookup_flag(&fname);
- if(fv == -1) {
+ if(fv == 0) {
LM_ERR("unsupported flag name [%.*s]\n", fname.len, fname.s);
return -1;
}
@@ -641,14 +642,14 @@ static int w_msg_iflag_reset(sip_msg_t *msg, char *pflag, char *p2)
*/
static int w_msg_iflag_is_set(sip_msg_t *msg, char *pflag, char *p2)
{
- int fv;
+ unsigned long long fv;
str fname;
if(fixup_get_svalue(msg, (gparam_t *)pflag, &fname)) {
LM_ERR("cannot get the msg flag name parameter\n");
return -1;
}
fv = msg_lookup_flag(&fname);
- if(fv == -1) {
+ if(fv == 0) {
LM_ERR("unsupported flag name [%.*s]\n", fname.len, fname.s);
return -1;
}