]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/hooks/ports/vlan
vlan: Refactor vlan_create()
[people/ms/network.git] / src / hooks / ports / vlan
index 98178e3d823ef38b5499ca849bdc73e92becf933..4715b1f6c9d1828aedca52e6c6e65867ff4b4702 100644 (file)
@@ -114,9 +114,15 @@ hook_create() {
        fi
 
        # Create the VLAN device
-       vlan_create "${port}" "${PARENT_PORT}" "${TAG}" "${ADDRESS}"
+       if ! vlan_create "${port}" \
+                       --address="${ADDRESS}" \
+                       --parent="${PARENT_PORT}" \
+                       --tag="${TAG}"; then
+               error "Could not create port: ${port}"
+               return ${EXIT_ERROR}
+       fi
 
-       exit ${EXIT_OK}
+       return ${EXIT_OK}
 }
 
 hook_remove() {