nat: Fix thinko... use the right fd to determine the IP of the bts

Use the fd of the BSC Connection to determine the IP address of the
BTS as we are seeing it.
This commit is contained in:
Holger Hans Peter Freyther 2010-04-06 11:17:56 +02:00
parent 92febd3ea4
commit 2066b8c267
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ int bsc_mgcp_policy_cb(struct mgcp_config *cfg, int endpoint, int state, const c
if (state == MGCP_ENDP_CRCX) {
struct sockaddr_in sock;
socklen_t len = sizeof(sock);
if (getpeername(nat->mgcp_queue.bfd.fd, (struct sockaddr *) &sock, &len) != 0) {
if (getpeername(bsc_con->write_queue.bfd.fd, (struct sockaddr *) &sock, &len) != 0) {
LOGP(DMGCP, LOGL_ERROR, "Can not get the peername...%d/%s\n",
errno, strerror(errno));
} else {