diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-11-19 16:04:10 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-11-20 14:05:17 +0100 |
commit | 48ecad48c7e79d3cc233d337db6950c9e5acbc16 (patch) | |
tree | 50553d0bfa4958ef3bdcf994bb35cd908bb669f7 | |
parent | 17e791666d527f83ad80b346ad58ecc39a913054 (diff) |
[mgcp] Do not forward or find the BTS if the endpoint is unused
Forget where the bts and network is located on DLCX and CRCX otherwise
we would have forwarded BTS data to the wrong endpoint and would have
not tried to discover the BTS again.
In the case of early bind we might get data from the BTS before
the CRCX and after DLCX... just ignore it then
-rw-r--r-- | openbsc/src/bsc_mgcp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsc/src/bsc_mgcp.c b/openbsc/src/bsc_mgcp.c index 4ebf6c84e..bb27d5634 100644 --- a/openbsc/src/bsc_mgcp.c +++ b/openbsc/src/bsc_mgcp.c @@ -234,6 +234,10 @@ static int rtp_data_cb(struct bsc_fd *fd, unsigned int what) return -1; } + /* do not forward aynthing... maybe there is a packet from the bts */ + if (endp->ci == CI_UNUSED) + return -1; + /* * Figure out where to forward it to. This code assumes that we * have received the Connection Modify and know who is a legitimate @@ -635,6 +639,8 @@ static void handle_create_con(struct msgb *msg, struct sockaddr_in *source) } MSG_TOKENIZE_END + /* initialize */ + endp->rtp = endp->rtcp = endp->bts_rtp = endp->bts_rtcp = 0; /* bind to the port now */ endp->rtp_port = rtp_calculate_port(ENDPOINT_NUMBER(endp), rtp_base_port); @@ -800,6 +806,8 @@ static void handle_delete_con(struct msgb *msg, struct sockaddr_in *source) bsc_unregister_fd(&endp->local_rtcp); } + endp->rtp = endp->rtcp = endp->bts_rtp = endp->bts_rtcp = 0; + return send_response(250, "DLCX", trans_id, source); error: |