mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-10-30 19:43:52 +00:00 
			
		
		
		
	mgw: Fix osmux conn local IP selection
The local Osmux IP address (cfg->osmux_addr) was never applied in generated MGCP messages. Instead, the RTP one was written into the MGCP message. Related: SYS#5987 Change-Id: I305f2501221e86d1eb0140446c03f36698f3194a
This commit is contained in:
		| @@ -111,6 +111,17 @@ void mgcp_get_local_addr(char *addr, struct mgcp_conn_rtp *conn) | |||||||
| 	bool rem_addr_set = !addr_is_any(&conn->end.addr); | 	bool rem_addr_set = !addr_is_any(&conn->end.addr); | ||||||
| 	char *bind_addr; | 	char *bind_addr; | ||||||
|  |  | ||||||
|  | 	/* Osmux: No smart IP addresses allocation is supported yet. Simply | ||||||
|  | 	 * return the one set in VTY config: */ | ||||||
|  | 	if (mgcp_conn_rtp_is_osmux(conn)) { | ||||||
|  | 		bind_addr = conn->conn->endp->trunk->cfg->osmux_addr; | ||||||
|  | 		LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, | ||||||
|  | 			 "using configured osmux bind ip as local bind ip %s\n", | ||||||
|  | 			 bind_addr); | ||||||
|  | 		osmo_strlcpy(addr, bind_addr, INET6_ADDRSTRLEN); | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	/* Try probing the local IP-Address */ | 	/* Try probing the local IP-Address */ | ||||||
| 	if (endp->trunk->cfg->net_ports.bind_addr_probe && rem_addr_set) { | 	if (endp->trunk->cfg->net_ports.bind_addr_probe && rem_addr_set) { | ||||||
| 		rc = osmo_sock_local_ip(addr, osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf)); | 		rc = osmo_sock_local_ip(addr, osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf)); | ||||||
| @@ -125,7 +136,7 @@ void mgcp_get_local_addr(char *addr, struct mgcp_conn_rtp *conn) | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	/* Select from preconfigured IP-Addresses. We don't have bind_addr for Osmux (yet?). */ | 	/* Select from preconfigured IP-Addresses. */ | ||||||
| 	if (rem_addr_set) { | 	if (rem_addr_set) { | ||||||
| 		/* Check there is a bind IP for the RTP traffic configured, | 		/* Check there is a bind IP for the RTP traffic configured, | ||||||
| 		 * if so, use that IP-Address */ | 		 * if so, use that IP-Address */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user