diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-01-10 22:29:35 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-01-10 22:29:35 +0100 |
commit | 951f34b8857338b6cb9d09031a0ea3d2b157ab44 (patch) | |
tree | cce882498a7e10404ab792eb697352e78bae76c9 /openbsc/src/osmo-bsc_nat | |
parent | c2c0ea700bc5100645372c94d765ddb2b6f99285 (diff) |
nat: Use the link_id from the original message in the new DTAP message
SMS went from SAPI=3 to SAPI=0 and nobody notices on the NAT->MSC direction.
Diffstat (limited to 'openbsc/src/osmo-bsc_nat')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat_utils.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c index 93fb5b564..1d67c350c 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c @@ -1124,6 +1124,7 @@ struct msgb *bsc_nat_rewrite_msg(struct bsc_nat *nat, struct msgb *msg, struct b uint32_t len; uint8_t msg_type, proto; struct msgb *new_msg = NULL, *sccp; + uint8_t link_id; if (!imsi || strlen(imsi) < 5) return msg; @@ -1138,6 +1139,7 @@ struct msgb *bsc_nat_rewrite_msg(struct bsc_nat *nat, struct msgb *msg, struct b if (!hdr48) return msg; + link_id = msg->l3h[1]; proto = hdr48->proto_discr & 0x0f; msg_type = hdr48->msg_type & 0xbf; @@ -1150,7 +1152,7 @@ struct msgb *bsc_nat_rewrite_msg(struct bsc_nat *nat, struct msgb *msg, struct b return msg; /* wrap with DTAP, SCCP, then IPA. TODO: Stop copying */ - gsm0808_prepend_dtap_header(new_msg, 0); + gsm0808_prepend_dtap_header(new_msg, link_id); sccp = sccp_create_dt1(parsed->dest_local_ref, new_msg->data, new_msg->len); talloc_free(new_msg); |