bsc_nat_fsm: fix sccp_sap_get_peer_addr_in

Fix the logic to not always return src->local_sccp_addr. What we need to
know is the peer's address.

Related: SYS#5560
Change-Id: I0055c0fafe672db5ce7a616d94c8964e8d58968f
This commit is contained in:
Oliver Smith 2022-03-07 18:43:05 +01:00
parent 9acbb0b790
commit f2fe7d626a
1 changed files with 3 additions and 3 deletions

View File

@ -69,15 +69,15 @@ static struct bsc_nat_ss7_inst *ss7_inst_dest(struct bsc_nat_ss7_inst *src)
return g_bsc_nat->cn;
}
/* For connection-oriented messages, figure out which side is the BSCNAT,
/* For connection-oriented messages, figure out which side is not the BSCNAT,
* either the called_addr or calling_addr. */
static int sccp_sap_get_peer_addr_in(struct bsc_nat_ss7_inst *src, struct osmo_sccp_addr **peer_addr_in,
struct osmo_sccp_addr *called_addr, struct osmo_sccp_addr *calling_addr)
{
if (osmo_sccp_addr_ri_cmp(&src->local_sccp_addr, called_addr) == 0) {
if (osmo_sccp_addr_ri_cmp(&src->local_sccp_addr, called_addr) != 0) {
*peer_addr_in = called_addr;
return 0;
} else if (osmo_sccp_addr_ri_cmp(&src->local_sccp_addr, calling_addr) == 0) {
} else if (osmo_sccp_addr_ri_cmp(&src->local_sccp_addr, calling_addr) != 0) {
*peer_addr_in = calling_addr;
return 0;
}