aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2013-03-10 08:54:30 +0000
committerHarald Welte <laforge@gnumonks.org>2013-03-10 08:57:03 +0000
commit30a73d8544edc9c160df3f14095934ee59bddbb1 (patch)
tree14c3830018c9aa61898706bbb7c045f56eb81223
parent44408456141f94a716c7cd8c339ecd4bc05341b6 (diff)
PCU: respect the PCU-side "local port" as configured via L1 IF
This makes sure that the UDP local port of the Gb link is actually set to what is configured via OML from OpenBSC.
-rw-r--r--src/gprs_bssgp_pcu.cpp8
-rw-r--r--src/gprs_bssgp_pcu.h7
-rw-r--r--src/pcu_l1_if.cpp3
3 files changed, 11 insertions, 7 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 4f8c41e..17c3fe4 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -559,9 +559,10 @@ static void bvc_timeout(void *_priv)
}
/* create BSSGP/NS layer instances */
-int gprs_bssgp_create(uint32_t sgsn_ip, uint16_t sgsn_port, uint16_t nsei,
- uint16_t nsvci, uint16_t bvci, uint16_t mcc, uint16_t mnc, uint16_t lac,
- uint16_t rac, uint16_t cell_id)
+int gprs_bssgp_create(uint16_t local_port, uint32_t sgsn_ip,
+ uint16_t sgsn_port, uint16_t nsei, uint16_t nsvci, uint16_t bvci,
+ uint16_t mcc, uint16_t mnc, uint16_t lac, uint16_t rac,
+ uint16_t cell_id)
{
struct sockaddr_in dest;
int rc;
@@ -579,6 +580,7 @@ int gprs_bssgp_create(uint32_t sgsn_ip, uint16_t sgsn_port, uint16_t nsei,
return -EINVAL;
}
gprs_ns_vty_init(bssgp_nsi);
+ bssgp_nsi->nsip.local_port = local_port;
rc = gprs_ns_nsip_listen(bssgp_nsi);
if (rc < 0) {
LOGP(DBSSGP, LOGL_ERROR, "Failed to create socket\n");
diff --git a/src/gprs_bssgp_pcu.h b/src/gprs_bssgp_pcu.h
index 2d66188..d669c3a 100644
--- a/src/gprs_bssgp_pcu.h
+++ b/src/gprs_bssgp_pcu.h
@@ -51,9 +51,10 @@ int gprs_bssgp_pcu_rx_sign(struct msgb *msg, struct tlv_parsed *tp, struct bssgp
int gprs_bssgp_pcu_rcvmsg(struct msgb *msg);
-int gprs_bssgp_create(uint32_t sgsn_ip, uint16_t sgsn_port, uint16_t nsei,
- uint16_t nsvci, uint16_t bvci, uint16_t mcc, uint16_t mnc, uint16_t lac,
- uint16_t rac, uint16_t cell_id);
+int gprs_bssgp_create(uint16_t local_port, uint32_t sgsn_ip, uint16_t
+ sgsn_port, uint16_t nsei, uint16_t nsvci, uint16_t bvci,
+ uint16_t mcc, uint16_t mnc, uint16_t lac, uint16_t rac,
+ uint16_t cell_id);
void gprs_bssgp_destroy(void);
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 6b8b3fe..8d98c1e 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -420,7 +420,8 @@ bssgp_failed:
LOGP(DL1IF, LOGL_DEBUG, " remote_port=%d\n", info_ind->remote_port[0]);
LOGP(DL1IF, LOGL_DEBUG, " remote_ip=%d\n", info_ind->remote_ip[0]);
- rc = gprs_bssgp_create(info_ind->remote_ip[0], info_ind->remote_port[0],
+ rc = gprs_bssgp_create(info_ind->local_port[0],
+ info_ind->remote_ip[0], info_ind->remote_port[0],
info_ind->nsei, info_ind->nsvci[0], info_ind->bvci,
info_ind->mcc, info_ind->mnc, info_ind->lac, info_ind->rac,
info_ind->cell_id);