netdev
[Top] [All Lists]

Re: [PATCH] support for large number of network devices.

To: Stephen Hemminger <shemminger@xxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxx>, netdev@xxxxxxxxxxx
Subject: Re: [PATCH] support for large number of network devices.
From: Jean Tourrilhes <jt@xxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Jan 2004 13:39:08 -0800
Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA.
E-mail: jt@hpl.hp.com
Organisation: HP Labs Palo Alto
Reply-to: jt@xxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
Stephen Hemminger wrote :
> 
> When using pseudo network devices, and really big machines; there is
> sometimes a need to have a lot of network devices.  This replaces the
> existing 2.6.1 limit of 100 entries an was O(n^2)
> with a algorithm that will handle up to 32768 entries with O(n) behaviour.

        You may want to be careful about buffer overflow in
dev->name. The old code did not check for it, because it was replacing
'%d' with a most 2 char ('0' to '99').
        The new code may create overflow for device names such as :
                'reallylongname%d'
        And you don't seem the catch that (unless I overlooked something).

        The problem is more messy that it looks like, because there is
no sane way to handle overflow. You can return an error to the driver,
and the driver may bail out properly (or crash), but the end user has
no way to overcome the issue and get its card loaded (short of editing
the driver and recompiling the kernel).
        So, there is a bit of auding to do first. I know for example
the HostAP create such long names.
        But that's only my humble opinion ;-)

        Jean

<Prev in Thread] Current Thread [Next in Thread>