From patchwork Fri Apr 29 10:39:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max X-Patchwork-Id: 616680 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 3qx9Dw3lWGz9s0M for ; Fri, 29 Apr 2016 20:39:44 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 1B50F13FD8; Fri, 29 Apr 2016 10:39:43 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from mail.sysmocom.de (mail.sysmocom.de [IPv6:2a01:4f8:191:444c::2:4]) by lists.osmocom.org (Postfix) with ESMTP id 2D88E13FBD for ; Fri, 29 Apr 2016 10:39:40 +0000 (UTC) Received: from mail.sysmocom.de (mail.sysmocom.de [144.76.43.93]) by mail.sysmocom.de (Postfix) with ESMTP id 03D3E1B9E32; Fri, 29 Apr 2016 10:39:40 +0000 (UTC) Received: from pbell.local (ip5b418565.dynamic.kabel-deutschland.de [91.65.133.101]) by mail.sysmocom.de (Postfix) with ESMTPSA id BCD101B9E31; Fri, 29 Apr 2016 10:39:39 +0000 (UTC) From: msuraev@sysmocom.de To: openbsc@lists.osmocom.org Subject: [PATCH 3/3] Set connected mode after setting remote address Date: Fri, 29 Apr 2016 12:39:35 +0200 Message-Id: <1461926375-18893-3-git-send-email-msuraev@sysmocom.de> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1461926375-18893-1-git-send-email-msuraev@sysmocom.de> References: <1461926375-18893-1-git-send-email-msuraev@sysmocom.de> X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" From: Max ortp: according to oRTP documentation rtp_session_set_connected_mode() uses the address set by rtp_session_set_remote_addr() - move the function call accordingly. Fixes: OS#1661 --- src/trau/osmo_ortp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index 5ab5bf5..3313798 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -390,16 +390,17 @@ int osmo_rtp_socket_connect(struct osmo_rtp_socket *rs, const char *ip, uint16_t "set remote %s:%u\n", ip, port); return 0; } + + rc = rtp_session_set_remote_addr(rs->sess, ip, port); + if (rc < 0) + return rc; + /* enable the use of connect() so later getsockname() will * actually return the IP address that was chosen for the local * sid of the connection */ rtp_session_set_connected_mode(rs->sess, 1); rs->flags &= ~OSMO_RTP_F_DISABLED; - rc = rtp_session_set_remote_addr(rs->sess, ip, port); - if (rc < 0) - return rc; - if (rs->flags & OSMO_RTP_F_POLL) return rc; else