summaryrefslogtreecommitdiffstats
path: root/src/net/netdev_settings.c
diff options
context:
space:
mode:
authorMichael Brown2013-08-27 17:28:54 +0200
committerMichael Brown2013-08-27 17:39:43 +0200
commitae0124cd404c0ee25152bef70bee9e2030054ce7 (patch)
treebedcc132a7e4a8248db644702e47e432cbd23c98 /src/net/netdev_settings.c
parent[settings] Make built-in settings a linker table (diff)
downloadipxe-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/net/netdev_settings.c')
-rw-r--r--src/net/netdev_settings.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net/netdev_settings.c b/src/net/netdev_settings.c
index 52e8007d..994e0506 100644
--- a/src/net/netdev_settings.c
+++ b/src/net/netdev_settings.c
@@ -120,6 +120,7 @@ static int netdev_fetch_bustype ( struct net_device *netdev, void *data,
[BUS_TYPE_EISA] = "EISA",
[BUS_TYPE_MCA] = "MCA",
[BUS_TYPE_ISA] = "ISA",
+ [BUS_TYPE_TAP] = "TAP",
};
struct device_description *desc = &netdev->dev->desc;
const char *bustype;
@@ -127,7 +128,7 @@ static int netdev_fetch_bustype ( struct net_device *netdev, void *data,
assert ( desc->bus_type < ( sizeof ( bustypes ) /
sizeof ( bustypes[0] ) ) );
bustype = bustypes[desc->bus_type];
- assert ( bustypes != NULL );
+ assert ( bustype != NULL );
strncpy ( data, bustype, len );
return strlen ( bustype );
}