]> git.ipfire.org Git - network.git/commitdiff
hotplug: Don't try to remove gre0
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Sep 2018 17:51:26 +0000 (19:51 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Sep 2018 17:51:26 +0000 (19:51 +0200)
This device cannot be removed

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.device
src/udev/network-hotplug

index f5162391d2f29307b737cab37533641f253db20b..b753ae378da2fd0bf721417c98fba520dd143a4d 100644 (file)
@@ -298,6 +298,13 @@ device_is_wireless() {
        [ -d "${SYS_CLASS_NET}/${device}/phy80211" ]
 }
 
+device_is_gre() {
+       local device="${1}"
+       assert isset device
+
+       __device_type_matches "${device}" 778
+}
+
 device_is_vti() {
        local device="${1}"
        assert isset device
index f058dd7541f4653870e23cbddbf2dfeb4ef466b7..c810bf2e6750b8eb917e7ac3895b280f394e9d5a 100644 (file)
@@ -84,6 +84,13 @@ case "${SUBSYSTEM}" in
                                        log WARNING "Got to hotplug event for a port which does not exist: ${INTERFACE}"
 
                                        # Try to remove the device again
+
+                                       # GRE
+                                       if device_is_gre "${INTERFACE}" && [ "${INTERFACE}" = "gre0" ]; then
+                                               log DEBUG "gre0 cannot be removed"
+                                               exit ${EXIT_OK}
+                                       fi
+
                                        TYPE="$(device_get_type "${INTERFACE}")"
                                        case "${TYPE}" in
                                                bonding)