diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..2c9f8ba 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libosmocore depend >= 1.9.0 we need osmo_sockaddr_from_str_and_uint() 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 { 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 @@ static int llsk_rx_audio_conn_establish_req(struct hnb *hnb, struct hnb_audio_co /* 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..6213eee 100644 --- a/src/osmo-hnodeb/rtp.c +++ b/src/osmo-hnodeb/rtp.c @@ -263,14 +263,13 @@ static void rtp_rx_cb(struct osmo_rtp_socket *rs, const uint8_t *rtp_pl, "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,15 +304,16 @@ int rtp_conn_setup(struct rtp_conn *conn, const struct osmo_sockaddr *rem_addr, 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; } conn->id = rc; /* We use local port as rtp conn ID */ + osmo_sockaddr_from_str_and_uint(&conn->loc_addr, local_ipstr, rc); /* 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); @@ -324,12 +324,14 @@ int rtp_conn_setup(struct rtp_conn *conn, const struct osmo_sockaddr *rem_addr, goto free_ret; } - /* osmo_rtp_socket_connect() is broken, OS#5356 */ - //rc = rtp_get_bound_addr(rs, &conn->loc_addr); - rc = rtp_get_bound_addr(rs, rem_addr, &conn->loc_addr); - if (rc < 0) { - LOGUE(ue, DRTP, LOGL_ERROR, "Cannot obtain locally bound IP/port: %d\n", rc); - goto free_ret; + if (osmo_sockaddr_is_any(&conn->loc_addr)) { + /* osmo_rtp_socket_connect() is broken, OS#5356 */ + //rc = rtp_get_bound_addr(rs, &conn->loc_addr); + rc = rtp_get_bound_addr(rs, rem_addr, &conn->loc_addr); + if (rc < 0) { + LOGUE(ue, DRTP, LOGL_ERROR, "Cannot obtain locally bound IP/port: %d\n", rc); + goto free_ret; + } } /* Now configure the IuUP layer: */