Bug 2527 - brctl with linux 2.4
Summary: brctl with linux 2.4
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: 1.17.x
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-06 15:22 UTC by emmeciu
Modified: 2010-09-14 09:27 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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