[linux] Give tap devices a name and bus type

Give tap devices a meaningful name, and avoid segmentation faults when
attempting to retrieve ${net0/bustype} by assigning a new bus type for
tap devices.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2013-08-27 16:28:54 +01:00
parent 3e975ecf3f
commit ae0124cd40
3 changed files with 8 additions and 1 deletions

View File

@@ -216,6 +216,9 @@ static int tap_probe(struct linux_device *device, struct linux_device_request *r
}
nic->interface = if_setting->value;
snprintf ( device->dev.name, sizeof ( device->dev.name ), "%s",
nic->interface );
device->dev.desc.bus_type = BUS_TYPE_TAP;
if_setting->applied = 1;
/* Apply rest of the settings */