summaryrefslogtreecommitdiffstats
path: root/src/net/vlan.c
diff options
context:
space:
mode:
authorMichael Brown2010-11-26 00:45:30 +0100
committerMichael Brown2010-11-26 02:09:35 +0100
commit7e1b1d6145a36ae7ad1c58663c7116f96fada1f9 (patch)
tree6b670dc748b4ed3745aac04a99cc355acb545634 /src/net/vlan.c
parent[nvo] Allow fragment list to be omitted (diff)
downloadipxe-7e1b1d6145a36ae7ad1c58663c7116f96fada1f9.tar.gz
ipxe-7e1b1d6145a36ae7ad1c58663c7116f96fada1f9.tar.xz
ipxe-7e1b1d6145a36ae7ad1c58663c7116f96fada1f9.zip
[vlan] Allow duplicate VLAN creation attempts
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/vlan.c')
-rw-r--r--src/net/vlan.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/net/vlan.c b/src/net/vlan.c
index a764f305..5ecc7e1c 100644
--- a/src/net/vlan.c
+++ b/src/net/vlan.c
@@ -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 ) );