Opened 11 years ago
Closed 11 years ago
#10183 closed bug (fixed)
Incorrect handling of non-existing network devices
Reported by: | jackburton | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Network & Internet/Stack | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
The Network stack handles non-existing network devices incorrectly:
ifconfig /dev/net/foobar auto-config
causes the network stack to allocate resources for the non-existing interface.
The stack or the ethernet module should probably check if a device with the given name exists in allocate_device_interface() or in ethernet_init() respectively. Reproducible under qemu.
Attachments (3)
Change History (9)
by , 11 years ago
comment:1 by , 11 years ago
by , 11 years ago
Attachment: | 0001-Check-if-device-exists-before-creating-ethernet-inte.patch added |
---|
Proposed patch
comment:2 by , 11 years ago
patch: | 0 → 1 |
---|
comment:3 by , 11 years ago
The attached patch fixes the bug (although not the problem described in comment 1). Is it okay to apply it ? Is there any reason why the ethernet device should be created without the /dev/net/ entry ? I'm not that familiar with our device manager, so...
by , 11 years ago
Attachment: | 0002-Check-the-given-path-for.patch added |
---|
Avoid creating interface for paths with ".."
comment:5 by , 11 years ago
While in theory you are allowed to name your interface as you wish, since /dev/net/ is handled by the ethernet device driver, your patches definitely make sense, so please go ahead.
Interestingly, this allows for things like
or
But the interface exists, and the net_stack will happily try to assign an address via DHCP.