Bug 198467 - Package timidity++ lacks IPv6 support
Summary: Package timidity++ lacks IPv6 support
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: timidity++ (Show other bugs)
(Show other bugs)
Version: rawhide
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Hans de Goede
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: IPv6Blocker
TreeView+ depends on / blocked
 
Reported: 2006-07-11 12:41 UTC by Peter Vrabec
Modified: 2008-03-09 18:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-20 21:46:44 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
TiMidity++ IPv6 Patch (ver. 2.13.2) (11.64 KB, patch)
2008-02-05 12:08 UTC, Milan Zázrivec
no flags Details | Diff

Description Peter Vrabec 2006-07-11 12:41:23 UTC
This bug was reported automaticaly in connection with IPv6 project.
Our aim is to support IPv6 in all Fedora Core packages so FC6 and RHEL5 will be ready for IPv6.
		
This package seems to lack IPv6 support.

Comment 1 Hans de Goede 2007-10-13 06:36:41 UTC
Hi all,

Nigel is no longer the timidity maintainer, Jindrich Novy and I are now
maintaing timidity, reassigning this to me.

Are there any docs anywhere on how to fix this in general?


Comment 2 Milan Zázrivec 2008-02-05 12:08:40 UTC
Created attachment 293992 [details]
TiMidity++ IPv6 Patch (ver. 2.13.2)

Attached patch might help with the problem.

Comment 3 Hans de Goede 2008-02-05 15:28:59 UTC
(In reply to comment #2)
> Created an attachment (id=293992) [edit]
> TiMidity++ IPv6 Patch (ver. 2.13.2)
> 
> Attached patch might help with the problem.

Thanks!

Has anyone actually tested this patch?


Comment 4 Milan Zázrivec 2008-02-20 11:58:03 UTC
The patch was reviewed internally in Red Hat, I also made some
local testing with couple of IPv6 http and ftp URIs.

You may wanna try something like:
timidity http://[your:ipv6:site:local:address]:port/midifile.mid

or

timidity ftp://[your:ipv6:site:local:address]:port/midifile.mid

or you may want to put some HTTP / FTP IPv6 proxy into timidity config
file to see if it works.

Comment 5 Hans de Goede 2008-02-20 21:46:44 UTC
(In reply to comment #4)
> The patch was reviewed internally in Red Hat, I also made some
> local testing with couple of IPv6 http and ftp URIs.
> 

Ok, thats good enough for me applied and build in rawhide, thanks!


Comment 6 Hans de Goede 2008-03-09 08:34:05 UTC
Milan,

I've found (and just fixed) a bug in your ipv6 patch. This comment is not meant
to be complaining I'm very grateful for the patch. But I think / guess you've
written more ipv6 patches, and chances are you've made the same mistake elsewhere.

The timidity++ server code has a piece of code where it compares 2 addresses
(for security validation).

You replaced the ipv4 only code like this:
-    if(control_client.sin_addr.s_addr != in.sin_addr.s_addr)
-       return send_status(513, "Security violation:  Address mismatch");
+    /* Not quite protocol independent */
+    switch (((struct sockaddr *) &control_client)->sa_family)
+    {
+        case AF_INET:
+            if (((struct sockaddr_in *) &control_client)->sin_addr.s_addr !=
+                ((struct sockaddr_in *) &in)->sin_addr.s_addr)
+                return send_status(513, "Security violation: Address mismatch"
+            break;
+        case AF_INET6:
+            if (((struct sockaddr_in6 *) &control_client)->sin6_addr.s6_addr !
+                ((struct sockaddr_in6 *) &in)->sin6_addr.s6_addr)
+                return send_status(513, "Security violation: Address mismatch"
+            break;
+    }

Notice how in the ipv6 case you compare (using != ) the 2 .s6_addr members of
the sin6_addr struct. However .s6_addr is an array so you are comparing
addresses making the comparison always say they are not equal.

I've replaced this with:

         case AF_INET6:
             if (memcmp(
                 ((struct sockaddr_in6 *) &control_client)->sin6_addr.s6_addr,
                 ((struct sockaddr_in6 *) &in)->sin6_addr.s6_addr, 16))
                 return send_status(513, "Security violation: Address mismatch"
             break;

Which seems to work for me (now ipv6 clients can connect) Cheers!


Comment 7 Milan Zázrivec 2008-03-09 18:39:40 UTC
I agree -- memcmp does the trick, my bad, thanks for letting me know :-)


Note You need to log in before you can comment on or make changes to this bug.