]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
sbin: start-networking: adjust allow-hotplug behavior to ifupdown
authorJulien Fortin <julien@cumulusnetworks.com>
Thu, 23 Feb 2017 09:42:34 +0000 (16:42 +0700)
committerJulien Fortin <julien@cumulusnetworks.com>
Tue, 13 Mar 2018 03:53:01 +0000 (14:53 +1100)
Ticket: Bug#855598: src:ifupdown2: allow-hotplug behaves differently, not UPing interfaces
Reviewed By: Roopa
Testing Done: mark an interface (ethX) as hotplug then reboot

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
sbin/start-networking

index f4796d83c45a503c2f661de145af5038711f90f9..5232e88642689be59dddc7fb0d7008ae55781d63 100755 (executable)
@@ -87,7 +87,9 @@ ifup_hotplug () {
                            do
                                    link=${iface##:*}
                                    link=${link##.*}
-                                   if [ -e "/sys/class/net/$link" ]
+
+                                   ip link set "$iface" up || true
+                                   if [ "$(cat /sys/class/net/$link/operstate)" = up ]
                                    then
                                        echo "$iface"
                                    fi