Date: 25 Feb 2012 18:57:10 -0500 From: Howard Goldstein <hg@cally.queue.to> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/165481: [PATCH] audio/cpige broken on amd64 , patch attached Message-ID: <20120225235710.90864.qmail@cally.queue.to> Resent-Message-ID: <201202260030.q1Q0UDs1000586@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 165481 >Category: ports >Synopsis: [PATCH] audio/cpige broken on amd64 , patch attached >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Feb 26 00:30:13 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Howard Goldstein >Release: FreeBSD 8.3-PRERELEASE amd64 >Organization: >Environment: System: FreeBSD cally.queue.to 8.3-PRERELEASE FreeBSD 8.3-PRERELEASE #0: Fri Feb 17 19:05:27 EST 2012 hg@cally.queue.to:/usr/obj/usr/src/sys/CALLY amd64 >Description: audio/cpige fails to look up host name addresses on amd64 and probably other 64 bit platforms. The underlying problem is that the upstream considers inet_addr() to have failed when it returns ( (long) -1 ) but our libc correctly returns something different, that is, (in_addr_t) INADDR_NONE, when the dotted quad conversion inet_addr tries to do fails. >How-To-Repeat: Attempt to capture a stream that has a hostname in the url on a 64 bit platform. Log inspection shows something like this [17:09:39] [DEBUG PRIO 3][File: mynet.c][Line: 104] Port: 80 [17:09:39] [DEBUG PRIO 3][File: mynet.c][Line: 131] Socket Creation Sucessful. [17:09:39] [DEBUG PRIO 3][File: mynet.c][Line: 132] Connection in progress... [17:09:39] [DEBUG PRIO 1][File: mynet.c][Line: 137] Remote host connection faile d. [17:09:39] [DEBUG PRIO 2][File: mynet.c][Line: 60] Reconnecting to http://example.com:80/stream [try 1] in 5 sec. because example.com is never sent through gethostbyname. Connection succeeds when specifying the url with a dotted quad... >Fix: Quick workaround is to specify the url to capture as a dotted quad in the config file, ex url="http://192.168.0.1:80/stream" FIX Going forward, please include this patch to audio/cpige The following .shar applied to ${PORTSDIR}/audio/cpige creates ./files/patch-myname-compat64 . This patch is tested on amd64 and i386 # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # files/patch-myname-compat64 # echo x - files/patch-myname-compat64 sed 's/^X//' >files/patch-myname-compat64 << '70e015748989102958d1a91fd866efa4' X--- ../../../cpige.orig/work/cpige-1.5/mynet.c 2006-08-20 10:51:17.000000000 -0400 X+++ ./mynet.c 2012-02-25 18:08:03.276113898 -0500 X@@ -86,7 +86,7 @@ X { X struct sockaddr_in serverSockAddr; X struct hostent *serverHostEnt; X- long hostAddr; X+ in_addr_t hostAddr; X X #if WIN32 X int res; X@@ -105,7 +105,7 @@ X hostAddr = inet_addr(servername); X X /* If it is an ip address */ X- if ((long) hostAddr != (long)-1) X+ if ( hostAddr != INADDR_NONE ) X memcpy(&serverSockAddr.sin_addr, &hostAddr, sizeof(hostAddr)); X else { X serverHostEnt = gethostbyname(servername); 70e015748989102958d1a91fd866efa4 exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120225235710.90864.qmail>