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 ) );