From 0108033823a1e47bc659cfc4d32423a69c86ec33 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 18 Feb 2022 10:14:54 +0100 Subject: [PATCH] bsc_nat_fsm: drop called addr verify This is already done by the SCCP stack, as Harald explained it: "Think of a TCP socket where you have already bound a socket and then still do recvmsg to check if the destination address is what you expect." Related: SYS#5560 Change-Id: Id9bfbf38a61ef66a4246f752ef487d8a09fea173 --- src/osmo-bsc-nat/bsc_nat_fsm.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/osmo-bsc-nat/bsc_nat_fsm.c b/src/osmo-bsc-nat/bsc_nat_fsm.c index e5767b1..ea57e32 100644 --- a/src/osmo-bsc-nat/bsc_nat_fsm.c +++ b/src/osmo-bsc-nat/bsc_nat_fsm.c @@ -74,9 +74,7 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *scu) struct bsc_nat_ss7_inst *src = osmo_sccp_user_get_priv(scu); struct bsc_nat_ss7_inst *dest = ss7_inst_dest(src); struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; - struct osmo_sccp_addr *my_addr; struct osmo_sccp_addr *peer_addr; - char buf[255]; int rc = -1; switch (OSMO_PRIM_HDR(oph)) { @@ -98,17 +96,9 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *scu) case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): /* connection-less data received */ - my_addr = &prim->u.unitdata.called_addr; peer_addr = &prim->u.unitdata.calling_addr; LOG_SCCP(src, peer_addr, LOGL_DEBUG, "%s(%s)\n", __func__, osmo_scu_prim_name(oph)); - if (osmo_sccp_addr_ri_cmp(&src->local_sccp_addr, my_addr)) { - osmo_sccp_addr_to_str_buf(buf, sizeof(buf), NULL, my_addr); - LOG_SCCP(src, peer_addr, LOGL_ERROR, "Called address %s is not the locally configured" - " address %s\n", buf, osmo_sccp_inst_addr_name(NULL, &src->local_sccp_addr)); - goto error; - } - /* Figure out called party in dest. TODO: build and use a * mapping of peer_addr + conn_id <--> dest_ss7. For now, this * is simplified by assuming there is only one MSC, one BSC. */