X-Git-Url: http://git.ipfire.org/?p=people%2Fstevee%2Fnetwork.git;a=blobdiff_plain;f=src%2Fhooks%2Fports%2Fvlan;fp=src%2Fhooks%2Fports%2Fvlan;h=98178e3d823ef38b5499ca849bdc73e92becf933;hp=f19eda493aaaf2910a6b87de198923dcb3e931fb;hb=4776723194ad4d1ba75d1b373c1892e44ddcbf97;hpb=a2f35a67d83bd3a4a4438c2b7b8cbc2ee0002e38 diff --git a/src/hooks/ports/vlan b/src/hooks/ports/vlan index f19eda49..98178e3d 100644 --- a/src/hooks/ports/vlan +++ b/src/hooks/ports/vlan @@ -103,7 +103,15 @@ hook_create() { device_exists "${port}" && exit ${EXIT_OK} # Read configruation - port_settings_read "${port}" + if ! port_settings_read "${port}"; then + return ${EXIT_ERROR} + fi + + # Check if the parent port exists + if ! port_exists "${PARENT_PORT}"; then + error "Port '${PARENT_PORT}' does not exist" + return ${EXIT_ERROR} + fi # Create the VLAN device vlan_create "${port}" "${PARENT_PORT}" "${TAG}" "${ADDRESS}"