Bug 198467 - Package timidity++ lacks IPv6 support
Package timidity++ lacks IPv6 support
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: timidity++ (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Hans de Goede
Fedora Extras Quality Assurance
:
Depends On:
Blocks: IPv6Blocker
  Show dependency treegraph
 
Reported: 2006-07-11 08:41 EDT by Peter Vrabec
Modified: 2008-03-09 14:39 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-20 16:46:44 EST
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 07:08 EST, Milan Zazrivec
no flags Details | Diff

  None (edit)
Description Peter Vrabec 2006-07-11 08:41:23 EDT
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 02:36:41 EDT
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 Zazrivec 2008-02-05 07:08:40 EST
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 10:28:59 EST
(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 Zazrivec 2008-02-20 06:58:03 EST
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 16:46:44 EST
(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 04:34:05 EDT
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 Zazrivec 2008-03-09 14:39:40 EDT
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.