From: Alex Zeffertt <ajz@cambridgebroadband.com>
To: "Majjari Vikram(TLS-ESG), Bangalore" <Majjari.Vikram@hcl.in>,
bridge@lists.osdl.org
Subject: Re: [Bridge] bridge_list orphans in linux-2.4
Date: Fri, 15 Dec 2006 15:01:51 +0000 [thread overview]
Message-ID: <4582B8DF.2010702@cambridgebroadband.com> (raw)
In-Reply-To: <AA48EE0D609E8547912F0039B5E47BC261BE14@SHI-EXCHBE1.shipara.hcltech.com>
Hi Majjari,
We've solved the problem now. It turned out that the bridge_list in the
kernel was not being corrupted. The problem was actually that
"brctl show" was only returning the last 32 bridges created. We upped
this to 2048, which required a brctl change and also a kernel module change.
The patch is attached.
HTH,
Alex
===================================================================
RCS file: /newcvs/intel-linux/net/bridge/br_ioctl.c,v
retrieving revision 1.3
retrieving revision 1.3.14.1
diff -u -r1.3 -r1.3.14.1
--- br_ioctl.c 20 Jul 2004 10:13:42 -0000 1.3
+++ br_ioctl.c 2 Nov 2006 16:59:14 -0000 1.3.14.1
@@ -5,7 +5,7 @@
* Authors:
* Lennert Buytenhek <buytenh@gnu.org>
*
- * $Id: br_ioctl.c,v 1.3 2004/07/20 10:13:42 ajz Exp $
+ * $Id: br_ioctl.c,v 1.3.14.1 2006/11/02 16:59:14 srowe Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -233,18 +233,22 @@
case BRCTL_GET_BRIDGES:
{
- int i;
- int indices[64];
+ int *indices;
+ int ret = 0;
- for (i=0;i<64;i++)
- indices[i] = 0;
+ if (arg1 >= 2048)
+ return -ENOMEM;
+ indices = kmalloc(arg1*sizeof(int), GFP_KERNEL);
+ if (indices == NULL)
+ return -ENOMEM;
+
+ memset(indices, 0, arg1*sizeof(int));
- if (arg1 > 64)
- arg1 = 64;
arg1 = br_get_bridge_ifindices(indices, arg1);
- if (copy_to_user((void *)arg0, indices, arg1*sizeof(int)))
- return -EFAULT;
+ ret = copy_to_user((void *)arg0, indices, arg1*sizeof(int))
+ ? -EFAULT : arg1;
+ kfree(indices);
return arg1;
}
===================================================================
RCS file: /newcvs/third-party/bridge-utils/libbridge/libbridge_init.c,v
retrieving revision 1.3
retrieving revision 1.3.14.1
diff -u -r1.3 -r1.3.14.1
--- libbridge_init.c 25 May 2004 16:42:58 -0000 1.3
+++ libbridge_init.c 2 Nov 2006 16:59:55 -0000 1.3.14.1
@@ -158,10 +158,10 @@
int br_make_bridge_list()
{
int i;
- int ifindices[32];
+ int ifindices[2047];
int num;
- num = br_ioctl(BRCTL_GET_BRIDGES, (unsigned long)ifindices, 32);
+ num = br_ioctl(BRCTL_GET_BRIDGES, (unsigned long)ifindices, 2047);
if (num < 0)
return errno;
Majjari Vikram(TLS-ESG), Bangalore wrote:
> Hi I have a similar problem. Can u please send me how u have solved it.
>
>
>
> /*/ /*/
>
> /*/Regards,/*/
>
> /*/Vikram./*/////
>
>
>
> DISCLAIMER:
> -----------------------------------------------------------------------------------------------------------------------
>
> The contents of this e-mail and any attachment(s) are confidential and
> intended for the named recipient(s) only.
> It shall not attach any liability on the originator or HCL or its
> affiliates. Any views or opinions presented in
> this email are solely those of the author and may not necessarily
> reflect the opinions of HCL or its affiliates.
> Any form of reproduction, dissemination, copying, disclosure,
> modification, distribution and / or publication of
> this message without the prior written consent of the author of this
> e-mail is strictly prohibited. If you have
> received this email in error please delete it and notify the sender
> immediately. Before opening any mail and
> attachments please check them for viruses and defect.
>
> -----------------------------------------------------------------------------------------------------------------------
>
next parent reply other threads:[~2006-12-15 15:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AA48EE0D609E8547912F0039B5E47BC261BE14@SHI-EXCHBE1.shipara.hcltech.com>
2006-12-15 15:01 ` Alex Zeffertt [this message]
2006-12-15 18:24 ` [Bridge] bridge_list orphans in linux-2.4 Stephen Hemminger
2006-12-15 18:31 ` Stephen Hemminger
2006-12-18 10:01 ` Alex Zeffertt
2006-09-21 13:42 Alex Zeffertt
2006-09-21 22:56 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4582B8DF.2010702@cambridgebroadband.com \
--to=ajz@cambridgebroadband.com \
--cc=Majjari.Vikram@hcl.in \
--cc=bridge@lists.osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox