Browse code

core: kemi - proper conditions for operators in sr_kemi_hdr_match_content()

Daniel-Constantin Mierla authored on 19/10/2020 10:59:15
Showing 1 changed files
... ...
@@ -2441,13 +2441,13 @@ static int sr_kemi_hdr_match_content(sip_msg_t *msg, str *hname, str *op,
2441 2441
 	if(op->len == 2) {
2442 2442
 		if(strncasecmp(op->s, "eq", 2) == 0) {
2443 2443
 			opval = 1;
2444
-		} if(strncasecmp(op->s, "ne", 2) == 0) {
2444
+		} else if(strncasecmp(op->s, "ne", 2) == 0) {
2445 2445
 			opval = 2;
2446
-		} if(strncasecmp(op->s, "sw", 2) == 0) {
2446
+		} else if(strncasecmp(op->s, "sw", 2) == 0) {
2447 2447
 			opval = 3;
2448
-		} if(strncasecmp(op->s, "in", 2) == 0) {
2448
+		} else if(strncasecmp(op->s, "in", 2) == 0) {
2449 2449
 			opval = 4;
2450
-		} if(strncasecmp(op->s, "re", 2) == 0) {
2450
+		} else if(strncasecmp(op->s, "re", 2) == 0) {
2451 2451
 			opval = 5;
2452 2452
 			LM_ERR("operator not implemented: %.*s\n", op->len, op->s);
2453 2453
 			return SR_KEMI_FALSE;
... ...
@@ -2468,7 +2468,7 @@ static int sr_kemi_hdr_match_content(sip_msg_t *msg, str *hname, str *op,
2468 2468
 		} else if(hidx->s[0]=='l' || hidx->s[0]=='L') {
2469 2469
 			/* last */
2470 2470
 			hidxval = 2;
2471
-		} else if(hidx->s[0]=='a' || hidx->s[0]=='a') {
2471
+		} else if(hidx->s[0]=='a' || hidx->s[0]=='A') {
2472 2472
 			/* all */
2473 2473
 			hidxval = 3;
2474 2474
 		} else if(hidx->s[0]=='o' || hidx->s[0]=='O') {