]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/functions/functions.bridge
ipsec: security policies: Fix typos in plural variables
[people/ms/network.git] / src / functions / functions.bridge
index 46ca80c2b63f66357dd617c417001408bd5a4431..38f51ed3edb4b91ba640f495eb2d986b44839ad6 100644 (file)
@@ -30,10 +30,10 @@ bridge_create() {
        while [ $# -gt 0 ]; do
                case "${1}" in
                        --address=*)
-                               address=$(cli_get_val ${1})
+                               address=$(cli_get_val "${1}")
                                ;;
                        --mtu=*)
-                               mtu=$(cli_get_val ${1})
+                               mtu=$(cli_get_val "${1}")
                                ;;
                        *)
                                error "Unrecognized argument: ${1}"
@@ -104,7 +104,7 @@ bridge_attach_device() {
        fi
 
        # If device is already attached, exit silently.
-       if listmatch ${device} $(bridge_get_members ${bridge}); then
+       if list_match ${device} $(bridge_get_members ${bridge}); then
                return ${EXIT_OK}
        fi
 
@@ -113,16 +113,13 @@ bridge_attach_device() {
        device_adjust_mtu "${device}" "${bridge}"
 
        # Actually connect bridge and device.
-       cmd_quiet ip link set ${device} master ${bridge}
-       local ret=$?
-
-       if [ ${ret} -eq ${EXIT_OK} ]; then
-               log DEBUG "bridge: device '${device}' has been attached to bridge '${bridge}'"
-       else
-               log ERROR "bridge: could not attach device '${device}' to bridge '${bridge}': ${ret}"
+       if ! device_set_master "${device}" "${bridge}"; then
+               log ERROR "Could not attach ${device} to bridge ${bridge}"
+               return ${EXIT_ERROR}
        fi
 
-       return ${ret}
+       log DEBUG "${device} has been attached to bridge ${bridge}"
+       return ${EXIT_OK}
 }
 
 bridge_detach_device() {
@@ -145,7 +142,7 @@ bridge_detach_device() {
        fi
 
        # If device is not attched, exit silently.
-       if ! listmatch ${device} $(bridge_get_members ${bridge}); then
+       if ! list_match ${device} $(bridge_get_members ${bridge}); then
                return ${EXIT_OK}
        fi