]> git.ipfire.org Git - network.git/commitdiff
Don't try identifying non-existant device when attaching to a zone
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 31 May 2017 17:55:15 +0000 (19:55 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 31 May 2017 22:22:51 +0000 (00:22 +0200)
This resulted in an error message which is unnecessary.

Fixes #11174

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.zone

index a04b08317017e3cee48854c99c947b0fe1bfd9d9..c72750601ef96f05496e61ed4c619ba97d30b6b5 100644 (file)
@@ -730,7 +730,9 @@ zone_port_attach() {
        assert isset hook
 
        # Make the port briefly flash if supported
-       port_identify "${port}" --background
+       if device_exists ${port}; then
+               port_identify "${port}" --background
+       fi
 
        hook_zone_exec "${hook}" "port_attach" "${zone}" "${port}" "$@"
        local ret="${?}"