Hello,

Running kernel 2.4.20 and bridge-utils 0.9.6

If you set up X bridge interfaces where X > 32, the brctl userland
program will not be able to inspect or configure the first interface(s)
set up anymore.

However the bridge code continues to bridge.

If we apply a simple patch to the kernel and brctl program (simply
increasing the size of an array) it works fine.

It seems like there is some limitation in the IOCTL interface as for how
many interfaces will be listed when you ask the kernel.

Looking at net/bridge/br_ioctl.c in br_ioctl_deviceless()

        case BRCTL_GET_BRIDGES:
        {
                int i;
                int indices[64];

                for (i=0;i<64;i++)
                        indices[i] = 0;

                if (arg1 > 64)
                        arg1 = 64;
                arg1 = br_get_bridge_ifindices(indices, arg1);
                if (copy_to_user((void *)arg0, indices,
arg1*sizeof(int)))
                        return -EFAULT;

                return arg1;
        }

There is a hardcoded limit of 64 interfaces, in the brctl program there
is a hardcoded limit of 32 interfaces.

However there seems to be no real limit anywhere near those numbers, so
I wonder why it's there.

If it should be there, the limit should at least be set in a public
header so the userland and kernel agree on it.  And the brctl software
should not add more interfaces than it can list / manage.

-- 

drift | frode nordahl

powertech information systems

nedre slottsgate 5
0157 oslo

tlf | + 47 23 01 00 00
fax | + 47 23 01 00 01
dir | + 47 23 01 00 45

email | [EMAIL PROTECTED]
web | www.powertech.no


Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to