From e2c5028dc4ca8b3f9f4846b658a9b80ec3e70f4d Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 20 Feb 2010 00:36:03 +0100 Subject: [PATCH] [sccp] Use msgb->l2h instead of msgb->data for CR Using msgb->data only works as long as msgb->data == msgb->l2h.. In the case of receiving a MSU unit from a E1 link, or even receiving the IPA header we will have some non SCCP data at msgb->data and then cast garbage to what we think is making sense.. Use msgb->l2h and everything is fine. --- openbsc/src/sccp/sccp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbsc/src/sccp/sccp.c b/openbsc/src/sccp/sccp.c index a19926630..94fd0175c 100644 --- a/openbsc/src/sccp/sccp.c +++ b/openbsc/src/sccp/sccp.c @@ -208,7 +208,7 @@ int _sccp_parse_connection_request(struct msgb *msgb, struct sccp_parse_result * static const u_int32_t called_offset = offsetof(struct sccp_connection_request, variable_called); - struct sccp_connection_request *req = (struct sccp_connection_request *)msgb->data; + struct sccp_connection_request *req = (struct sccp_connection_request *)msgb->l2h; struct sccp_optional_data optional_data; /* header check */