Fix for bridge-utils for Sparc64

2004-04-08 Thread Small, Jim
I know this is only on the periphery of interest for this group, but since
I've seen questions asked about it and it's the Distro I tested and am using
the fix on, I thought this might be of interest...

--

Thanks to Santiago (Santi) Leon for providing the following fix to me to
enable bridging on the Sparc64 platform.  I have tested it under Debian
unstable, using Kernel 2.4.25, and bridge-utils-0.9.6.tar.gz.

The fix is as follows:
Download bridge-utils-0.9.6.tar.gz source from bridge.sourceforge.net, untar
it, edit 
bridge-utils/libbridge/libbridge_devif.c and search for a line that has
this:
  return ioctl(br_socket_fd, SIOCDEVPRIVATE + 3, ifr);
and replace it with this:
  return ioctl(br_socket_fd, SIOCDEVPRIVATE, ifr);
(basically just remove the +3)... run make and again and try:

(After you rebuild the bridge utilities, these should work beautifully!)
bridge-utils/brctl/brctl addbr br0
bridge-utils/brctl/brctl adddif br0 eth0
bridge-utils/brctl/brctl show

Santi mentioned that the newer kernels don't make SIOCDEVPRIVATE+3 a 64-bit
compatible 
ioctl and that's why it doesn't work on the Sparc64 architecture.  He also
mentioned that the same fix works for the PowerPC64 Architecture so it might
help for other 64bit architecture platforms.

Note also that this is not scheduled to be fixed in bridge-tuils-0.9.7, so
for now this seems to be the best work around for 64bit platforms.

Here is a diff too:
# diff -Nru bridge-utils/libbridge/libbridge_devif.c
bridge-utils/libbridge/libbridge_devif.c.orig 
--- bridge-utils/libbridge/libbridge_devif.c2004-04-01
21:10:55.0 -0500
+++ bridge-utils/libbridge/libbridge_devif.c.orig   2002-01-16
07:04:45.0 -0500
@@ -56,7 +56,7 @@
memcpy(ifr.ifr_name, br-ifname, IFNAMSIZ);
((unsigned long long *)(ifr.ifr_data))[0] = (unsigned long
long)(unsigned long)args;
 
-   return ioctl(br_socket_fd, SIOCDEVPRIVATE, ifr);
+   return ioctl(br_socket_fd, SIOCDEVPRIVATE + 3, ifr);
 }
 #endif

Thanks again Santi,
Jim



Re: Fix for bridge-utils for Sparc64

2004-04-08 Thread Jan-Benedict Glaw
On Thu, 2004-04-08 09:48:19 -0400, Small, Jim [EMAIL PROTECTED]
wrote in message [EMAIL PROTECTED]:
 Here is a diff too:
 # diff -Nru bridge-utils/libbridge/libbridge_devif.c
 bridge-utils/libbridge/libbridge_devif.c.orig 
 --- bridge-utils/libbridge/libbridge_devif.c2004-04-01
 21:10:55.0 -0500
 +++ bridge-utils/libbridge/libbridge_devif.c.orig   2002-01-16
 07:04:45.0 -0500

You reversed the diff and your email client mangled it, too...

 @@ -56,7 +56,7 @@
 memcpy(ifr.ifr_name, br-ifname, IFNAMSIZ);
 ((unsigned long long *)(ifr.ifr_data))[0] = (unsigned long
 long)(unsigned long)args;
  
 -   return ioctl(br_socket_fd, SIOCDEVPRIVATE, ifr);
 +   return ioctl(br_socket_fd, SIOCDEVPRIVATE + 3, ifr);
  }
  #endif
 

Just adding or removing some magic constants isn't good. If there's
something missing on the kernel side, just fix it there.

MfG, JBG

-- 
   Jan-Benedict Glaw   [EMAIL PROTECTED]. +49-172-7608481
   Eine Freie Meinung in  einem Freien Kopf| Gegen Zensur | Gegen Krieg
fuer einen Freien Staat voll Freier Bürger | im Internet! |   im Irak!
   ret = do_actions((curr | FREE_SPEECH)  ~(NEW_COPYRIGHT_LAW | DRM | TCPA));


signature.asc
Description: Digital signature


RE: Fix for bridge-utils for Sparc64

2004-04-08 Thread Small, Jim
 -Original Message-
 
 You reversed the diff and your email client mangled it, too...
 

You're right about the reversed diff...oops.

Looks like my client sent the message OK, not sure why it got wrapped
later...

 
 
 Just adding or removing some magic constants isn't good. If there's
 something missing on the kernel side, just fix it there.
 

Agreed.  If I knew enough to fix it I would!  As 64bit architectures get
more popular, I'm hoping many of these 32-64bit issues will disappear.  In
the mean time though, this lets those of us with an UltraSPARC and a qfe
card do bridging.

 Jim