Merge remote branch 'origin/master'
diff --git a/openbsc/include/openbsc/ipaccess.h b/openbsc/include/openbsc/ipaccess.h
index 3956877..21a5c17 100644
--- a/openbsc/include/openbsc/ipaccess.h
+++ b/openbsc/include/openbsc/ipaccess.h
@@ -3,6 +3,9 @@
#include "e1_input.h"
+#define IPA_TCP_PORT_OML 3002
+#define IPA_TCP_PORT_RSL 3003
+
struct ipaccess_head {
u_int16_t len; /* network byte order */
u_int8_t proto;
diff --git a/openbsc/src/input/ipaccess.c b/openbsc/src/input/ipaccess.c
index 3e1d43a..2f79a6b 100644
--- a/openbsc/src/input/ipaccess.c
+++ b/openbsc/src/input/ipaccess.c
@@ -662,12 +662,12 @@
e1h->gsmnet = gsmnet;
/* Listen for OML connections */
- ret = make_sock(&e1h->listen_fd, 3002, listen_fd_cb);
+ ret = make_sock(&e1h->listen_fd, IPA_TCP_PORT_OML, listen_fd_cb);
if (ret < 0)
return ret;
/* Listen for RSL connections */
- ret = make_sock(&e1h->rsl_listen_fd, 3003, rsl_listen_fd_cb);
+ ret = make_sock(&e1h->rsl_listen_fd, IPA_TCP_PORT_RSL, rsl_listen_fd_cb);
return ret;
}
diff --git a/openbsc/src/ipaccess-proxy.c b/openbsc/src/ipaccess-proxy.c
index 00b6340..dd9d6b1 100644
--- a/openbsc/src/ipaccess-proxy.c
+++ b/openbsc/src/ipaccess-proxy.c
@@ -245,7 +245,7 @@
ipbc->id_tags[i] = talloc_size(tall_bsc_ctx, len);
else
#endif
- ipbc->id_tags[i] = talloc_realloc_size(tall_bsc_ctx,
+ ipbc->id_tags[i] = talloc_realloc_size(ipbc,
ipbc->id_tags[i], len);
if (!ipbc->id_tags[i])
return -ENOMEM;
@@ -464,7 +464,7 @@
memcpy(ipbc->id_resp, msg->data, ipbc->id_resp_len);
/* Create OML TCP connection towards BSC */
- sin.sin_port = htons(3002);
+ sin.sin_port = htons(IPA_TCP_PORT_OML);
ipbc->bsc_oml_conn = connect_bsc(&sin, OML_TO_BSC, ipbc);
if (!ipbc->bsc_oml_conn) {
ret = -EIO;
@@ -588,7 +588,7 @@
ipbc->rsl_conn[trx_id] = ipc;
/* Create RSL TCP connection towards BSC */
- sin.sin_port = htons(3003);
+ sin.sin_port = htons(IPA_TCP_PORT_RSL);
ipbc->bsc_rsl_conn[trx_id] =
connect_bsc(&sin, RSL_TO_BSC | (trx_id << 8), ipbc);
if (!ipbc->bsc_oml_conn)
@@ -703,7 +703,7 @@
llist_for_each_entry(ipbc, &ipp->bts_list, list) {
/* if OML to BSC is dead, try to restore it */
if (ipbc->oml_conn && !ipbc->bsc_oml_conn) {
- sin.sin_port = htons(3002);
+ sin.sin_port = htons(IPA_TCP_PORT_OML);
logp_ipbc_uid(DINP, LOGL_NOTICE, ipbc, 0);
LOGPC(DINP, LOGL_NOTICE, "OML Trying to reconnect\n");
ipbc->bsc_oml_conn = connect_bsc(&sin, OML_TO_BSC, ipbc);
@@ -726,7 +726,7 @@
priv_nr = ipbc->rsl_conn[i]->fd.priv_nr;
priv_nr &= ~0xff;
priv_nr |= RSL_TO_BSC;
- sin.sin_port = htons(3003);
+ sin.sin_port = htons(IPA_TCP_PORT_RSL);
logp_ipbc_uid(DINP, LOGL_NOTICE, ipbc, priv_nr >> 8);
LOGPC(DINP, LOGL_NOTICE, "RSL Trying to reconnect\n");
ipbc->bsc_rsl_conn[i] = connect_bsc(&sin, priv_nr, ipbc);
@@ -807,14 +807,11 @@
struct ipa_proxy_conn *ipc = bfd->data;
struct ipa_bts_conn *ipbc = ipc->bts_conn;
struct ipa_proxy_conn *bsc_conn;
- struct msgb *msg = msgb_alloc(PROXY_ALLOC_SIZE, "Abis/IP");
+ struct msgb *msg;
struct ipaccess_head *hh;
int ret = 0;
char *btsbsc;
- if (!msg)
- return -ENOMEM;
-
if ((bfd->priv_nr & 0xff) <= 2)
btsbsc = "BTS";
else
@@ -1072,12 +1069,14 @@
ipp->reconn_timer.data = ipp;
/* Listen for OML connections */
- ret = make_listen_sock(&ipp->oml_listen_fd, 3002, OML_FROM_BTS, listen_fd_cb);
+ ret = make_listen_sock(&ipp->oml_listen_fd, IPA_TCP_PORT_OML,
+ OML_FROM_BTS, listen_fd_cb);
if (ret < 0)
return ret;
/* Listen for RSL connections */
- ret = make_listen_sock(&ipp->rsl_listen_fd, 3003, RSL_FROM_BTS, listen_fd_cb);
+ ret = make_listen_sock(&ipp->rsl_listen_fd, IPA_TCP_PORT_RSL,
+ RSL_FROM_BTS, listen_fd_cb);
return ret;
}