Bug 165481 - [PATCH] audio/cpige broken on amd64 , patch attached
Summary: [PATCH] audio/cpige broken on amd64 , patch attached
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Ion-Mihai "IOnut" Tetcu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-26 00:30 UTC by Howard Goldstein
Modified: 2012-08-12 10:40 UTC (History)
0 users

See Also:


Attachments
file.shar (1.03 KB, text/plain)
2012-02-26 00:30 UTC, Howard Goldstein
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Howard Goldstein 2012-02-26 00:30:13 UTC
	
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.

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

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...
Comment 1 Edwin Groothuis freebsd_committer 2012-02-26 00:30:26 UTC
Responsible Changed
From-To: freebsd-ports-bugs->itetcu

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2012-08-12 10:36:45 UTC
Author: itetcu
Date: Sun Aug 12 09:36:30 2012
New Revision: 302431
URL: http://svn.freebsd.org/changeset/ports/302431

Log:
  - fix looking up the host name addresses on 64 bits platforms
  (use in_addr_t instead of long and check it against INADDR_NONE)
  - adjust MASTERSITES and WWW
  
  Please note that the project is dead upstream.
  
  PR:		165481
  Submitted by:	Howard Goldstein

Added:
  head/audio/cpige/files/patch-mynet.c   (contents, props changed)
Modified:
  head/audio/cpige/Makefile   (contents, props changed)
  head/audio/cpige/pkg-descr   (contents, props changed)

Modified: head/audio/cpige/Makefile
==============================================================================
--- head/audio/cpige/Makefile	Sun Aug 12 09:14:06 2012	(r302430)
+++ head/audio/cpige/Makefile	Sun Aug 12 09:36:30 2012	(r302431)
@@ -7,9 +7,10 @@
 
 PORTNAME=	cpige
 DISTVERSION=	1.5
+PORTREVISION=	1
 CATEGORIES=	audio
-MASTER_SITES=	http://ed.zehome.com/cpige/ \
-		http://T32.TecNik93.com/FreeBSD/ports/sources/cpige/
+MASTER_SITES=	http://old.ed.zehome.com/cpige/ \
+		http://T32.TecNik93.com/FreeBSD/ports/cpige/sources/
 
 MAINTAINER=	itetcu@FreeBSD.org
 COMMENT=	Icecast/Shoutcast stream ripper

Added: head/audio/cpige/files/patch-mynet.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/cpige/files/patch-mynet.c	Sun Aug 12 09:36:30 2012	(r302431)
@@ -0,0 +1,20 @@
+--- ./mynet.c.orig	2006-08-20 17:51:17.000000000 +0300
++++ ./mynet.c	2012-08-12 12:29:05.000000000 +0300
+@@ -86,7 +86,7 @@
+ {
+   struct sockaddr_in serverSockAddr;
+   struct hostent *serverHostEnt;
+-  long hostAddr;
++  in_addr_t hostAddr;
+   
+ #if WIN32
+   int res;
+@@ -105,7 +105,7 @@
+   hostAddr = inet_addr(servername); 
+   
+   /* If it is an ip address */
+-  if ((long) hostAddr != (long)-1)
++  if ( hostAddr != INADDR_NONE ) 
+     memcpy(&serverSockAddr.sin_addr, &hostAddr, sizeof(hostAddr));
+   else {
+     serverHostEnt = gethostbyname(servername);

Modified: head/audio/cpige/pkg-descr
==============================================================================
--- head/audio/cpige/pkg-descr	Sun Aug 12 09:14:06 2012	(r302430)
+++ head/audio/cpige/pkg-descr	Sun Aug 12 09:36:30 2012	(r302431)
@@ -2,4 +2,4 @@ cPige records an audio stream, separatin
 "Artist - Track.mp3" files. It can also record on an
 hour-by-hour basis.
 
-WWW: http://ed.zehome.com/?page=cpige-en
+WWW: http://old.ed.zehome.com/?page=cpige
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Ion-Mihai "IOnut" Tetcu freebsd_committer 2012-08-12 10:36:51 UTC
State Changed
From-To: open->closed

Committed. Thanks!