received param is not added to the Via header in cases when host IP in Via1 header is a substring of src_ip
We have an issue with the opensips 1.11.5-tls. Received header is not added to the Via header even when src IP and IP in the Via1 header are different.
Here is an example
Src IP is 192.168.1.121
IP in Via is 192.168.1.12
Looking into the code of opensips/msg_translator.c
I can see that check_ip_address function from opensips/resolve.c
is used. It looks like there is a bug in the function, which returns 0 for the cases like above, because comparison is done only up to the Via host length and length of IP is not taken into consideration
The easies fix would be just add (len == name->len) as a first condition with && conjunction to the highlighted if statement .
Could you please check and issue a patch for this?
IPC ranks #33 in IDC's Top 100 FinTech
This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unintended recipients are prohibited from taking action on the basis of information in this e-mail. E-mail messages may contain computer viruses or other defects, may not be accurately replicated on other systems, or may be intercepted, deleted or interfered with without the knowledge of the sender or the intended recipient. If you are not comfortable with the risks associated with e-mail messages, you may decide not to use e-mail to communicate with IPC. IPC reserves the right, to the extent and under circumstances permitted by applicable law, to retain, monitor and intercept e-mail messages to and from its systems.