From f76aee438e6391731a89fcba8a130a7acbe160ce Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 2 May 2010 21:29:36 +0200 Subject: [gprs] correctly calculate the length of the BSSGP PDUs --- openbsc/src/gprs_bssgp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'openbsc') diff --git a/openbsc/src/gprs_bssgp.c b/openbsc/src/gprs_bssgp.c index aceedb58..554738b5 100644 --- a/openbsc/src/gprs_bssgp.c +++ b/openbsc/src/gprs_bssgp.c @@ -200,7 +200,7 @@ int bssgp_tx_status(uint8_t cause, uint16_t *bvci, struct msgb *orig_msg) } if (orig_msg) msgb_tvlv_put(msg, BSSGP_IE_PDU_IN_ERROR, - msgb_l3len(orig_msg), msgb_bssgph(orig_msg)); + msgb_bssgp_len(orig_msg), msgb_bssgph(orig_msg)); return gprs_ns_sendmsg(bssgp_nsi, msg); } @@ -257,7 +257,7 @@ static int bssgp_rx_bvc_reset(struct msgb *msg, struct tlv_parsed *tp, static int bssgp_rx_ul_ud(struct msgb *msg) { struct bssgp_ud_hdr *budh = (struct bssgp_ud_hdr *) msgb_bssgph(msg); - int data_len = msgb_l3len(msg) - sizeof(*budh); + int data_len = msgb_bssgp_len(msg) - sizeof(*budh); struct tlv_parsed tp; int rc; @@ -285,7 +285,7 @@ static int bssgp_rx_suspend(struct msgb *msg) { struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_bssgph(msg); - int data_len = msgb_l3len(msg) - sizeof(*bgph); + int data_len = msgb_bssgp_len(msg) - sizeof(*bgph); struct tlv_parsed tp; int rc; @@ -307,7 +307,7 @@ static int bssgp_rx_resume(struct msgb *msg) { struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_bssgph(msg); - int data_len = msgb_l3len(msg) - sizeof(*bgph); + int data_len = msgb_bssgp_len(msg) - sizeof(*bgph); struct tlv_parsed tp; int rc; @@ -352,7 +352,7 @@ int gprs_bssgp_rcvmsg(struct msgb *msg) (struct bssgp_normal_hdr *) msgb_bssgph(msg); struct tlv_parsed tp; uint8_t pdu_type = bgph->pdu_type; - int data_len = msgb_l3len(msg) - sizeof(*bgph); + int data_len = msgb_bssgp_len(msg) - sizeof(*bgph); uint16_t bvci; /* PTP BVCI */ uint16_t ns_bvci = msgb_bvci(msg); int rc = 0; -- cgit v1.2.3