[S] Change in osmo-hnodeb[master]: Use 'iuh/local-ip' as local IP for RTP sockets

2023-11-20 Thread laforge
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 
Gerrit-MessageType: newchange


[S] Change in osmo-hnodeb[master]: Use 'iuh/local-ip' as local IP for RTP sockets

2023-11-21 Thread laforge
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-hnodeb/+/35075?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder


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
Depends: libosmocore.git Change-Id I6b5c0bf8ca97e6358d992fb2ff45ffd53ba15197
---
M TODO-RELEASE
M include/osmocom/hnodeb/rtp.h
M src/osmo-hnodeb/llsk_audio.c
M src/osmo-hnodeb/rtp.c
4 files changed, 30 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/75/35075/2
--
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: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


[S] Change in osmo-hnodeb[master]: Use 'iuh/local-ip' as local IP for RTP sockets

2023-11-22 Thread laforge
Attention is currently required from: osmith.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/35075?usp=email )

Change subject: Use 'iuh/local-ip' as local IP for RTP sockets
..


Patch Set 2:

(1 comment)

File src/osmo-hnodeb/rtp.c:

https://gerrit.osmocom.org/c/osmo-hnodeb/+/35075/comment/e35133bc_44e59877
PS2, Line 335:  }
> maybe add an else path here that logs an error and goes to free_ret?
why/where / what should that clause do? The existing code in rtp_get_bound_addr 
"does the right thing" for local INADDR_ANY/IN6ADDR_ANY.  In all other cases, 
conn->loc_addr already contains a specific local address and hence there's 
nothing to do.



--
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: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: osmith 
Gerrit-Attention: osmith 
Gerrit-Comment-Date: Wed, 22 Nov 2023 12:10:16 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith 
Gerrit-MessageType: comment


[S] Change in osmo-hnodeb[master]: Use 'iuh/local-ip' as local IP for RTP sockets

2023-11-22 Thread osmith
Attention is currently required from: laforge.

osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/35075?usp=email )

Change subject: Use 'iuh/local-ip' as local IP for RTP sockets
..


Patch Set 2: Code-Review+1


--
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: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Wed, 22 Nov 2023 12:12:25 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-hnodeb[master]: Use 'iuh/local-ip' as local IP for RTP sockets

2023-11-23 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/35075?usp=email )

Change subject: Use 'iuh/local-ip' as local IP for RTP sockets
..


Patch Set 2: Code-Review+2


--
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: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 23 Nov 2023 16:26:32 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-hnodeb[master]: Use 'iuh/local-ip' as local IP for RTP sockets

2023-11-23 Thread laforge
laforge has submitted this change. ( 
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
Depends: libosmocore.git Change-Id I6b5c0bf8ca97e6358d992fb2ff45ffd53ba15197
---
M TODO-RELEASE
M include/osmocom/hnodeb/rtp.h
M src/osmo-hnodeb/llsk_audio.c
M src/osmo-hnodeb/rtp.c
4 files changed, 30 insertions(+), 12 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved




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   whatdescription / commit summary line
+libosmocoredepend >= 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 *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..6213eee 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,15 +304,16 @@
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 @@
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