mirror of
https://github.com/ipxe/ipxe
synced 2025-12-14 07:50:43 +03:00
[vlan] Add support for IEEE 802.1Q VLANs
Originally-implemented-by: michael-dev@fami-braun.de Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -405,8 +405,10 @@ int register_netdev ( struct net_device *netdev ) {
|
||||
int rc;
|
||||
|
||||
/* Create device name */
|
||||
snprintf ( netdev->name, sizeof ( netdev->name ), "net%d",
|
||||
ifindex++ );
|
||||
if ( netdev->name[0] == '\0' ) {
|
||||
snprintf ( netdev->name, sizeof ( netdev->name ), "net%d",
|
||||
ifindex++ );
|
||||
}
|
||||
|
||||
/* Set initial link-layer address */
|
||||
netdev->ll_protocol->init_addr ( netdev->hw_addr, netdev->ll_addr );
|
||||
@@ -461,13 +463,13 @@ int netdev_open ( struct net_device *netdev ) {
|
||||
|
||||
DBGC ( netdev, "NETDEV %s opening\n", netdev->name );
|
||||
|
||||
/* Mark as opened */
|
||||
netdev->state |= NETDEV_OPEN;
|
||||
|
||||
/* Open the device */
|
||||
if ( ( rc = netdev->op->open ( netdev ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
/* Mark as opened */
|
||||
netdev->state |= NETDEV_OPEN;
|
||||
|
||||
/* Add to head of open devices list */
|
||||
list_add ( &netdev->open_list, &open_net_devices );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user