[EMAIL PROTECTED] (Dan Aloni) writes:
> Is there a special reason why dev->name is not a pointer?

One of the changes in 2.3 was to change dev->name from a pointer to the
char array.  A little bit painful (in terms of the number of changes,
rather than the complexity).

The reason for this is that dev->name needs to be writeable, each instance
of dev->name must not be shared, and there needs to be at least IFNAMSIZ
bytes allocated.

The problem that first triggered the change was that gcc was sharing
all instances of "eth%d", so there was a problem with multiple adaptors
referenced from the same source file.

It just happens that the kernel does not implement read-only strings
(as userspace does), but it could do in the future.  This would cause
problem if dev->name is a pointer.

Finally, looking through the many net drivers, many failed to reserve
IFNAMSIZ (currently 16) bytes.  Some allocated 8, some 9, some 17.

-- 
 `O O'  | [EMAIL PROTECTED]
// ^ \\ | http://www.pyrites.org.uk/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to