diff options
author | Michael Brown | 2013-08-27 17:28:54 +0200 |
---|---|---|
committer | Michael Brown | 2013-08-27 17:39:43 +0200 |
commit | ae0124cd404c0ee25152bef70bee9e2030054ce7 (patch) | |
tree | bedcc132a7e4a8248db644702e47e432cbd23c98 /src/drivers/linux | |
parent | [settings] Make built-in settings a linker table (diff) | |
download | ipxe-ae0124cd404c0ee25152bef70bee9e2030054ce7.tar.gz ipxe-ae0124cd404c0ee25152bef70bee9e2030054ce7.tar.xz ipxe-ae0124cd404c0ee25152bef70bee9e2030054ce7.zip |
[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>
Diffstat (limited to 'src/drivers/linux')
-rw-r--r-- | src/drivers/linux/tap.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/linux/tap.c b/src/drivers/linux/tap.c index 53bb16a3..99937d74 100644 --- a/src/drivers/linux/tap.c +++ b/src/drivers/linux/tap.c @@ -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 */ |