From patchwork Sun Nov 6 12:34:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 1314 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.90.1 with SMTP id o1csp663579vsb; Sun, 6 Nov 2016 04:35:05 -0800 (PST) X-Received: by 10.28.175.77 with SMTP id y74mr4649177wme.114.1478435705427; Sun, 06 Nov 2016 04:35:05 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id z62si5669091wmb.145.2016.11.06.04.35.05; Sun, 06 Nov 2016 04:35:05 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 97470680CA2; Sun, 6 Nov 2016 14:34:59 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 27672680D22 for ; Sun, 6 Nov 2016 14:34:54 +0200 (EET) Received: from mfilter9-d.gandi.net (mfilter9-d.gandi.net [217.70.178.138]) by relay2-d.mail.gandi.net (Postfix) with ESMTP id 60881C5A46 for ; Sun, 6 Nov 2016 13:34:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter9-d.gandi.net Received: from relay2-d.mail.gandi.net ([IPv6:::ffff:217.70.183.194]) by mfilter9-d.gandi.net (mfilter9-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id j1fQzUz0PI1y for ; Sun, 6 Nov 2016 13:34:55 +0100 (CET) X-Originating-IP: 213.47.41.20 Received: from localhost (213-47-41-20.cable.dynamic.surfer.at [213.47.41.20]) (Authenticated sender: michael@niedermayer.cc) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id B1DC8C5A43 for ; Sun, 6 Nov 2016 13:34:55 +0100 (CET) Date: Sun, 6 Nov 2016 13:34:24 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20161106123424.GT4602@nb4> References: <581EDA1C.3010506@telus.net> MIME-Version: 1.0 In-Reply-To: <581EDA1C.3010506@telus.net> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [FFmpeg-devel] [PATCH] workaround for IOS9 getaddrinfo in IPv6 only network use hardcode IPv4 address can not resolve port number. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On Sun, Nov 06, 2016 at 12:22:04AM -0700, Dave Yeo wrote: > On 08/24/16 03:46 AM, liu jc wrote: > >Signed-off-by: liujingchao > >--- > > libavformat/tcp.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > mode change 100644 => 100755 libavformat/tcp.c > > > >diff --git a/libavformat/tcp.c b/libavformat/tcp.c > >old mode 100644 > >new mode 100755 > >index c105479..fd10a56 > >--- a/libavformat/tcp.c > >+++ b/libavformat/tcp.c > >@@ -122,6 +122,14 @@ static int tcp_open(URLContext *h, const char *uri, int flags) > > cur_ai = ai; > > > > restart: > >+ // workaround for IOS9 getaddrinfo in IPv6 only network use hardcode IPv4 address can not resolve port number. > >+ if (cur_ai->ai_family == AF_INET6){ > >+ struct sockaddr_in6 * sockaddr_v6 = (struct sockaddr_in6 *)cur_ai->ai_addr; > >+ if (!sockaddr_v6->sin6_port){ > >+ sockaddr_v6->sin6_port = htons(port); > >+ } > >+ } > >+ > > fd = ff_socket(cur_ai->ai_family, > > cur_ai->ai_socktype, > > cur_ai->ai_protocol); > > > > src/libavformat/tcp.c: In function 'tcp_open': > src/libavformat/tcp.c:128:25: error: dereferencing pointer to > incomplete type > if (!sockaddr_v6->sin6_port){ > ^ > src/libavformat/tcp.c:129:24: error: dereferencing pointer to > incomplete type > sockaddr_v6->sin6_port = htons(port); > ^ > make: *** [libavformat/tcp.o] Error 1 > make: *** Waiting for unfinished jobs.... does this fix it: ? [...] diff --git a/libavformat/tcp.c b/libavformat/tcp.c index fd10a56..25abafc 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -122,6 +122,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags) cur_ai = ai; restart: +#if HAVE_STRUCT_SOCKADDR_IN6 // workaround for IOS9 getaddrinfo in IPv6 only network use hardcode IPv4 address can not resolve port number. if (cur_ai->ai_family == AF_INET6){ struct sockaddr_in6 * sockaddr_v6 = (struct sockaddr_in6 *)cur_ai->ai_addr; @@ -129,6 +130,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags) sockaddr_v6->sin6_port = htons(port); } } +#endif fd = ff_socket(cur_ai->ai_family, cur_ai->ai_socktype,