]> git.ipfire.org Git - network.git/commitdiff
hotplug: Handle special devices by name only
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Sep 2018 18:01:25 +0000 (20:01 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Sep 2018 18:01:25 +0000 (20:01 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/udev/network-hotplug

index 42bf319605d2c5395f384dceaa1db310ac99c730..873238f6b934005145ada6848f49115b6555a27c 100644 (file)
@@ -81,26 +81,17 @@ case "${SUBSYSTEM}" in
                if ! zone_exists "${INTERFACE}" && ! port_exists "${INTERFACE}"; then
                        case "${ACTION}" in
                                add)
+                                       # Ignore this for some special devices
+                                       case "${INTERFACE}" in
+                                               gre0|ip6gre0|ip6tnl0|ip6_vti0|ip_vti0)
+                                                       log DEBUG "Ignoring special device ${INTERFACE}"
+                                                       ;;
+                                       esac
+
                                        log WARNING "Got to hotplug event for a port which does not exist: ${INTERFACE}"
 
                                        # Try to remove the device again
 
-                                       # GRE6
-                                       if device_is_gre6 "${INTERFACE}" && [ "${INTERFACE}" = "ip6gre0" ]; then
-                                               log DEBUG "ip6gre0 cannot be removed"
-                                               exit ${EXIT_OK}
-
-                                       # GRE
-                                       elif device_is_gre "${INTERFACE}" && [ "${INTERFACE}" = "gre0" ]; then
-                                               log DEBUG "gre0 cannot be removed"
-                                               exit ${EXIT_OK}
-
-                                       # VTI
-                                       elif device_is_vti "${INTERFACE}" && [ "${INTERFACE}" = "ip_vti0" ]; then
-                                               log DEBUG "ip_vti0 cannot be removed"
-                                               exit ${EXIT_OK}
-                                       fi
-
                                        TYPE="$(device_get_type "${INTERFACE}")"
                                        case "${TYPE}" in
                                                bonding)