[sr-dev] git:master:8b759049: ims_auth: fix compilation warnigns

Victor Seva linuxmaniac at torreviejawireless.org
Tue Jun 7 12:19:54 CEST 2016


Module: kamailio
Branch: master
Commit: 8b75904980f7f7669fe35676a4042e387e29f352
URL: https://github.com/kamailio/kamailio/commit/8b75904980f7f7669fe35676a4042e387e29f352

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2016-06-06T12:05:39+02:00

ims_auth: fix compilation warnigns

> cxdx_avp.c:661:26: warning: comparison of constant 4 with boolean expression is always false [-Wtautological-constant-out-of-range-compare]
>         if (!avp||!avp->data.len==4) *item_number=0;
>                   ~~~~~~~~~~~~~~^ ~
> 1 warning generated.

> cxdx_mar.c:372:45: warning: comparison of constant 32 with boolean expression is always false [-Wtautological-constant-out-of-range-compare]
>                 if (!tmp->response_auth.len == 32
>                     ~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~

---

Modified: modules/ims_auth/cxdx_avp.c
Modified: modules/ims_auth/cxdx_mar.c

---

Diff:  https://github.com/kamailio/kamailio/commit/8b75904980f7f7669fe35676a4042e387e29f352.diff
Patch: https://github.com/kamailio/kamailio/commit/8b75904980f7f7669fe35676a4042e387e29f352.patch

---

diff --git a/modules/ims_auth/cxdx_avp.c b/modules/ims_auth/cxdx_avp.c
index a09e6b2..bd4031c 100644
--- a/modules/ims_auth/cxdx_avp.c
+++ b/modules/ims_auth/cxdx_avp.c
@@ -658,7 +658,7 @@ int cxdx_get_auth_data_item_answer(AAAMessage *msg, AAA_AVP **auth_data,
 
 	avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Item_Number,
 		IMS_vendor_id_3GPP,0);
-	if (!avp||!avp->data.len==4) *item_number=0;
+	if (!avp||avp->data.len!=4) *item_number=0;
 	else *item_number = get_4bytes(avp->data.s);
 	
 	avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Authentication_Scheme,
diff --git a/modules/ims_auth/cxdx_mar.c b/modules/ims_auth/cxdx_mar.c
index 1f81d0c..a949edd 100644
--- a/modules/ims_auth/cxdx_mar.c
+++ b/modules/ims_auth/cxdx_mar.c
@@ -373,7 +373,7 @@ void async_cdp_callback(int is_timeout, void *param, AAAMessage *maa, long elaps
                         &scscf_name_str, 0, result_hex);
                 pkg_free(etsi_nonce.s);
 
-                if (!tmp->response_auth.len == 32
+                if (tmp->response_auth.len != 32
                         || strncasecmp(tmp->response_auth.s, result_hex, 32)) {
                     LM_ERR("The HSS' Response-Auth is different from what we compute locally!\n"
                             " BUT! If you sent an MAR with auth scheme unknown (HSS-Selected Authentication), this is normal.\n"




More information about the sr-dev mailing list