laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnodeb/+/35075?usp=email )
Change subject: Use 'iuh/local-ip' as local IP for RTP sockets ...................................................................... Use 'iuh/local-ip' as local IP for RTP sockets Don't use the wildcard IPv4 address for RTP sockets, but instead use the address explicitly configured by the user for the Iuh interface. Closes: SYS#6657 Change-Id: I90e2cbb1765d4d2db5a19f64f0ff09cdc18b7911 --- M include/osmocom/hnodeb/rtp.h M src/osmo-hnodeb/llsk_audio.c M src/osmo-hnodeb/rtp.c 3 files changed, 19 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/75/35075/1 diff --git a/include/osmocom/hnodeb/rtp.h b/include/osmocom/hnodeb/rtp.h index 5eaec7b..dbb33c5 100644 --- a/include/osmocom/hnodeb/rtp.h +++ b/include/osmocom/hnodeb/rtp.h @@ -40,5 +40,6 @@ struct rtp_conn *rtp_conn_alloc(struct hnb_ue *ue); void rtp_conn_free(struct rtp_conn *conn); -int rtp_conn_setup(struct rtp_conn *conn, const struct osmo_sockaddr *rem_addr, const struct hnb_audio_conn_establish_req_param *ce_req); +int rtp_conn_setup(struct rtp_conn *conn, const char *local_ipstr, const struct osmo_sockaddr *rem_addr, + const struct hnb_audio_conn_establish_req_param *ce_req); int rtp_conn_tx_data(struct rtp_conn *conn, uint8_t frame_nr, uint8_t fqc, uint8_t rfci, const uint8_t *data, unsigned int data_len); diff --git a/src/osmo-hnodeb/llsk_audio.c b/src/osmo-hnodeb/llsk_audio.c index a545ee7..3140f83 100644 --- a/src/osmo-hnodeb/llsk_audio.c +++ b/src/osmo-hnodeb/llsk_audio.c @@ -210,7 +210,7 @@ /* Create the socket: */ conn = rtp_conn_alloc(ue); - if ((rc = rtp_conn_setup(conn, &rem_osa, ce_req)) < 0) { + if ((rc = rtp_conn_setup(conn, hnb->iuh.local_addr, &rem_osa, ce_req)) < 0) { LOGUE(ue, DLLSK, LOGL_ERROR, "Rx AUDIO-CONN_ESTABLISH.req: Failed to set up audio socket rem_addr=%s\n", rem_addrstr); return _send_conn_establish_cnf_failed(hnb, v0->context_id, 4); diff --git a/src/osmo-hnodeb/rtp.c b/src/osmo-hnodeb/rtp.c index 422e043..cdb3556 100644 --- a/src/osmo-hnodeb/rtp.c +++ b/src/osmo-hnodeb/rtp.c @@ -263,14 +263,13 @@ "Failed passing rx rtp up to IuUP layer: %d\n", rc); } -int rtp_conn_setup(struct rtp_conn *conn, const struct osmo_sockaddr *rem_addr, +int rtp_conn_setup(struct rtp_conn *conn, const char *local_ipstr, const struct osmo_sockaddr *rem_addr, const struct hnb_audio_conn_establish_req_param *ce_req) { int rc; char cname[256+4]; char name[32]; struct osmo_rtp_socket *rs; - const char *local_wildcard_ipstr = "0.0.0.0"; char remote_ipstr[INET6_ADDRSTRLEN]; uint16_t remote_port; struct osmo_iuup_rnl_prim *irp; @@ -305,7 +304,7 @@ rs->priv = conn; rs->rx_cb = &rtp_rx_cb; - rc = rtp_bind(hnb, rs, local_wildcard_ipstr); + rc = rtp_bind(hnb, rs, local_ipstr); if (rc < 0) { LOGUE(ue, DRTP, LOGL_ERROR, "Failed to bind RTP/RTCP sockets\n"); goto free_ret; @@ -313,7 +312,7 @@ conn->id = rc; /* We use local port as rtp conn ID */ /* Ensure RTCP SDES contains some useful information */ - snprintf(cname, sizeof(cname), "hnb@%s", local_wildcard_ipstr); + snprintf(cname, sizeof(cname), "hnb@%s", local_ipstr); snprintf(name, sizeof(name), "ue@%u-%u", conn->ue->conn_id, conn->id); osmo_rtp_set_source_desc(rs, cname, name, NULL, NULL, NULL, "OsmoHNodeB-" PACKAGE_VERSION, NULL); -- To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/35075?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnodeb Gerrit-Branch: master Gerrit-Change-Id: I90e2cbb1765d4d2db5a19f64f0ff09cdc18b7911 Gerrit-Change-Number: 35075 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <lafo...@osmocom.org> Gerrit-MessageType: newchange