david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[vlan] Allow duplicate VLAN creation attempts

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2010-11-25 23:45:30 +00:00
parent b87ed3295e
commit 7e1b1d6145
1 changed files with 11 additions and 5 deletions

View File

@ -301,6 +301,17 @@ int vlan_create ( struct net_device *trunk, unsigned int tag,
struct vlan_device *vlan;
int rc;
/* If VLAN already exists, just update the priority */
if ( ( netdev = vlan_find ( trunk, tag ) ) != NULL ) {
vlan = netdev->priv;
if ( priority != vlan->priority ) {
DBGC ( netdev, "VLAN %s priority changed from %d to "
"%d\n", netdev->name, vlan->priority, priority );
}
vlan->priority = priority;
return 0;
}
/* Sanity checks */
if ( trunk->ll_protocol->ll_addr_len != ETH_ALEN ) {
DBGC ( trunk, "VLAN %s cannot create VLAN for %s device\n",
@ -320,11 +331,6 @@ int vlan_create ( struct net_device *trunk, unsigned int tag,
rc = -EINVAL;
goto err_sanity;
}
if ( ( netdev = vlan_find ( trunk, tag ) ) != NULL ) {
DBGC ( netdev, "VLAN %s already exists\n", netdev->name );
rc = -EEXIST;
goto err_sanity;
}
/* Allocate and initialise structure */
netdev = alloc_etherdev ( sizeof ( *vlan ) );