diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-02-06 17:17:05 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-02-06 17:17:05 +0100 |
commit | fb9e06f310c3844fbe901551bb683de86c06e96e (patch) | |
tree | f3e9dd48fc220ed0cc7faae2d5ac461ba0c461cd | |
parent | c471d3d8a2fe0fd969a4228d1b095414777e9b39 (diff) |
[gb_proxy] make sure bssgp cell id is copied correctly
When we copy a msgb, we need to make sure the msgb_cb->bssgp_cell_id
pointer points to data in the new message, not in the old message.
Thanks to Dieter Spaar for spotting this.
-rw-r--r-- | openbsc/src/gprs/gb_proxy.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index b22906fee..373c2bea0 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -150,7 +150,9 @@ static struct msgb *msgb_copy(const struct msgb *msg, const char *name) new_cb->bssgph = new_msg->_data + (old_cb->bssgph - msg->_data); new_cb->llch = new_msg->_data + (old_cb->llch - msg->_data); - new_cb->bssgp_cell_id = old_cb->bssgp_cell_id; + /* bssgp_cell_id is a pointer into the old msgb, so we need to make + * it a pointer into the new msgb */ + new_cb->bssgp_cell_id = new_msg->_data + (old_cb->bssgp_cell_id - msg->_data); new_cb->nsei = old_cb->nsei; new_cb->bvci = old_cb->bvci; new_cb->tlli = old_cb->tlli; |