Bug 2527

Summary: brctl with linux 2.4
Product: Busybox Reporter: emmeciu
Component: NetworkingAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.17.x   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Host: Target:
Build:

Description emmeciu 2010-09-06 15:22:37 UTC
Hello,

I have a problem with brctl with my embedded device.
Everytime I try to create a bridge, I get the following:

# brctl addbr br0
brctl: bridge br0: Invalid argument

On linux, the bridge is created as a module and loaded at startup (with modprobe -v bridge I get no errors and with lsmod the bridge is listed).

Does anybody has every tried brctl with linux 2.4 ? I know there were compile errors with older busybox version and I was wondering if only compile issues have been fixed or also functional problem.

Thank you for your support.

Thierry Matalini

My system:
Linux kernel 2.4.20 (Montavista Pro 3.1)
BusyBox v1.17.2
PowerPC Linux plattform (MPC 8247, PowerQuiccII)
Comment 1 emmeciu 2010-09-14 09:27:07 UTC
I confirm that brctl is not working with linux 2.4
The linux 2.4 uses IOCTL in a different way when creating bridge or adding interfacs.

The IOCTL defines at the beginning of brctl.c file need to be removed and the following code must be updated:

-------
#ifdef SIOCBRADDBR || SIOCBRDELBR
    ioctl_or_perror_and_die(fd,
                            key == ARG_addbr ? SIOCBRADDBR : SIOCBRDELBR,
                            br, "bridge %s", br);
#else
    arm_ioctl(args,
              key == ARG_addbr ? BRCTL_ADD_BRIDGE : BRCTL_DEL_BRIDGE,
	      (unsigned long) br,
              0);
    ioctl_or_perror_and_die(fd, SIOCGIFBR, &args, "bridge %s", br);
#endif
-------

-------
#ifdef SIOCBRADDIF || SIOCBRDELIF
    ioctl_or_perror_and_die(fd,
                           key == ARG_addif ? SIOCBRADDIF : SIOCBRDELIF,
                           &ifr,
                           "bridge %s", br);
#else
    arm_ioctl(args,
              key == ARG_addif ? BRCTL_ADD_IF : BRCTL_DEL_IF,
              ifr.ifr_ifindex, 0);
    ifr.ifr_data = (char *)args;
    xioctl(fd, SIOCDEVPRIVATE, &ifr);
#endif
-------

Please feel free to contact me if you need more info.

Regs,
Thierry