]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/functions/functions.vlan
vlan: Simplify vlan_remove()
[people/ms/network.git] / src / functions / functions.vlan
index 8bcf169df8846eccab4ac1db66164c13b23eb078..d83e3ad30a9d02f00c2ca7d86d2060de22414a9b 100644 (file)
@@ -24,7 +24,7 @@ PROC_NET_VLAN_CONFIG="${PROC_NET_VLAN}/config"
 
 VLAN_PORT_INTERFIX="v"
 
-function vlan_init() {
+vlan_init() {
        ebtables-restore <<EOF
 *filter
 :INPUT ACCEPT
@@ -37,7 +37,7 @@ function vlan_init() {
 EOF
 }
 
-function vlan_create() {
+vlan_create() {
        local device=${1}
        assert isset device
 
@@ -87,17 +87,11 @@ function vlan_create() {
        return ${ret}
 }
 
-function vlan_remove() {
-       local device=${1}
-       assert isset device
-
-       # Set down device (if not already done).
-       device_set_down ${device}
-
-       device_delete ${device}
+vlan_remove() {
+       device_delete "$@"
 }
 
-function vlan_get_parent() {
+vlan_get_parent() {
        local device=${1}
        assert isset device
 
@@ -115,7 +109,7 @@ function vlan_get_parent() {
        return ${EXIT_ERROR}
 }
 
-function vlan_get_id() {
+vlan_get_id() {
        local device=${1}
        assert isset device
 
@@ -133,7 +127,7 @@ function vlan_get_id() {
        return ${EXIT_ERROR}
 }
 
-function vlan_get_by_parent_and_vid() {
+vlan_get_by_parent_and_vid() {
        local parent=${1}
        assert isset parent