aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-19 15:38:10 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-19 15:38:10 +0200
commite4860d7c487f84ae4893684f48e385a72efc1677 (patch)
treee476cd1af45d5c1772cc11a2b943b9f343b0a133 /openbsc/src/gprs
parent3c2a88dfe4929b90f15750afcc1b7b7226cfdae6 (diff)
[GPRS] NS: Make sure we allocate NS packet with headroom for FR/GRE
Diffstat (limited to 'openbsc/src/gprs')
-rw-r--r--openbsc/src/gprs/gb_proxy.c2
-rw-r--r--openbsc/src/gprs/gprs_ns.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index 11e8d887a..13ceb7383 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -124,7 +124,7 @@ static struct msgb *msgb_copy(const struct msgb *msg, const char *name)
{
struct msgb *new_msg;
- new_msg = msgb_alloc(msg->data_len, name);
+ new_msg = msgb_alloc_headroom(msg->data_len, NS_ALLOC_HEADROOM, name);
if (!new_msg)
return NULL;
diff --git a/openbsc/src/gprs/gprs_ns.c b/openbsc/src/gprs/gprs_ns.c
index 8b226b89e..9d0766c6d 100644
--- a/openbsc/src/gprs/gprs_ns.c
+++ b/openbsc/src/gprs/gprs_ns.c
@@ -232,7 +232,7 @@ static int gprs_ns_tx(struct gprs_nsvc *nsvc, struct msgb *msg)
static int gprs_ns_tx_simple(struct gprs_nsvc *nsvc, uint8_t pdu_type)
{
- struct msgb *msg = msgb_alloc(NS_ALLOC_SIZE, "GPRS/NS");
+ struct msgb *msg = gprs_ns_msgb_alloc();
struct gprs_ns_hdr *nsh;
log_set_context(BSC_CTX_NSVC, nsvc);
@@ -250,7 +250,7 @@ static int gprs_ns_tx_simple(struct gprs_nsvc *nsvc, uint8_t pdu_type)
int gprs_ns_tx_reset(struct gprs_nsvc *nsvc, uint8_t cause)
{
- struct msgb *msg = msgb_alloc(NS_ALLOC_SIZE, "GPRS/NS");
+ struct msgb *msg = gprs_ns_msgb_alloc();
struct gprs_ns_hdr *nsh;
uint16_t nsvci = htons(nsvc->nsvci);
uint16_t nsei = htons(nsvc->nsei);
@@ -278,7 +278,7 @@ int gprs_ns_tx_reset(struct gprs_nsvc *nsvc, uint8_t cause)
int gprs_ns_tx_status(struct gprs_nsvc *nsvc, uint8_t cause,
uint16_t bvci, struct msgb *orig_msg)
{
- struct msgb *msg = msgb_alloc(NS_ALLOC_SIZE, "GPRS/NS");
+ struct msgb *msg = gprs_ns_msgb_alloc();
struct gprs_ns_hdr *nsh;
uint16_t nsvci = htons(nsvc->nsvci);
@@ -326,7 +326,7 @@ int gprs_ns_tx_status(struct gprs_nsvc *nsvc, uint8_t cause,
int gprs_ns_tx_block(struct gprs_nsvc *nsvc, uint8_t cause)
{
- struct msgb *msg = msgb_alloc(NS_ALLOC_SIZE, "GPRS/NS");
+ struct msgb *msg = gprs_ns_msgb_alloc();
struct gprs_ns_hdr *nsh;
uint16_t nsvci = htons(nsvc->nsvci);
@@ -465,7 +465,7 @@ static void gprs_ns_timer_cb(void *data)
/* Section 9.2.6 */
static int gprs_ns_tx_reset_ack(struct gprs_nsvc *nsvc)
{
- struct msgb *msg = msgb_alloc(NS_ALLOC_SIZE, "GPRS/NS");
+ struct msgb *msg = gprs_ns_msgb_alloc();
struct gprs_ns_hdr *nsh;
uint16_t nsvci, nsei;
@@ -823,7 +823,7 @@ void gprs_ns_destroy(struct gprs_ns_inst *nsi)
static struct msgb *read_nsip_msg(struct bsc_fd *bfd, int *error,
struct sockaddr_in *saddr)
{
- struct msgb *msg = msgb_alloc(NS_ALLOC_SIZE, "Abis/IP/GPRS-NS");
+ struct msgb *msg = gprs_ns_msgb_alloc();
int ret = 0;
socklen_t saddr_len = sizeof(*saddr);