summaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/bsc_nat_sccp.h3
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_filter.c2
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat.c3
3 files changed, 7 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/bsc_nat_sccp.h b/openbsc/include/openbsc/bsc_nat_sccp.h
index 34aa6320a..0561df1f4 100644
--- a/openbsc/include/openbsc/bsc_nat_sccp.h
+++ b/openbsc/include/openbsc/bsc_nat_sccp.h
@@ -41,6 +41,9 @@ struct bsc_nat_parsed {
/* destination local reference */
struct sccp_source_reference *dest_local_ref;
+ /* original value */
+ struct sccp_source_reference original_dest_ref;
+
/* called ssn number */
int called_ssn;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_filter.c b/openbsc/src/osmo-bsc_nat/bsc_filter.c
index bbbba6994..6a9e99fb8 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_filter.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_filter.c
@@ -120,6 +120,8 @@ struct bsc_nat_parsed *bsc_nat_parse(struct msgb *msg)
parsed->sccp_type = sccp_determine_msg_type(msg);
parsed->src_local_ref = result.source_local_reference;
parsed->dest_local_ref = result.destination_local_reference;
+ if (parsed->dest_local_ref)
+ parsed->original_dest_ref = *parsed->dest_local_ref;
parsed->called_ssn = result.called.ssn;
parsed->calling_ssn = result.calling.ssn;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index a1fc035e6..d9fc0ca48 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -706,7 +706,8 @@ static int forward_sccp_to_bts(struct bsc_msc_connection *msc_con, struct msgb *
if (!con && parsed->sccp_type == SCCP_MSG_TYPE_RLSD) {
LOGP(DNAT, LOGL_NOTICE, "Sending fake RLC on RLSD message to network.\n");
/* Exchange src/dest for the reply */
- nat_send_rlc(msc_con, parsed->dest_local_ref, parsed->src_local_ref);
+ nat_send_rlc(msc_con, &parsed->original_dest_ref,
+ parsed->src_local_ref);
} else if (!con)
LOGP(DNAT, LOGL_ERROR, "Unknown connection for msg type: 0x%x from the MSC.\n", parsed->sccp_type);
}