Browse code

lcr: remove excessive conditional check in do_from_gw()

After an update of the bsearch(), which now supports matching not only
by the IP address, but also using the 'src_port', there is no need to check,
if the source port of a request matched the one from the 'lcr_gw'
('res' pointer will be NULL anyway, if ports don't match).

Nor do we need to check if it's zero.

Donat Zenichev authored on 19/09/2021 07:01:53 • Henning Westerholt committed on 20/09/2021 18:09:58
Showing 1 changed files
... ...
@@ -3035,8 +3035,7 @@ static int do_from_gw(struct sip_msg *_m, unsigned int lcr_id,
3035 3035
 
3036 3036
 	/* Store tag and flags and return result */
3037 3037
 	if((res != NULL)
3038
-					&& ((transport == PROTO_NONE) || (res->transport_code == transport))
3039
-					&& ((src_port == 0) || (res->port == src_port))) {
3038
+					&& ((transport == PROTO_NONE) || (res->transport_code == transport))) {
3040 3039
 		LM_DBG("request came from gw\n");
3041 3040
 		if(tag_avp_param) {
3042 3041
 			val.s.s = res->tag;