summaryrefslogtreecommitdiff
path: root/legacy/busybox/0017-ifupdown-do-not-fail-if-interface-disappears-during-.patch
diff options
context:
space:
mode:
authorKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-02-22 22:51:35 -0600
committerKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-02-22 22:51:35 -0600
commit4618f5695b7bd00c07d656e965db11b31f0d8b36 (patch)
tree9a3b5f59245e5e3e1183fd56ae907a06c588d1f1 /legacy/busybox/0017-ifupdown-do-not-fail-if-interface-disappears-during-.patch
parentd397ab02f9c6c4e5a0ac0a2d5331999d056ae27b (diff)
downloadpackages-4618f5695b7bd00c07d656e965db11b31f0d8b36.tar.gz
packages-4618f5695b7bd00c07d656e965db11b31f0d8b36.tar.bz2
packages-4618f5695b7bd00c07d656e965db11b31f0d8b36.tar.xz
packages-4618f5695b7bd00c07d656e965db11b31f0d8b36.zip
{system => legacy}/busybox: fucking inflatable fucking busybox
Diffstat (limited to 'legacy/busybox/0017-ifupdown-do-not-fail-if-interface-disappears-during-.patch')
-rw-r--r--legacy/busybox/0017-ifupdown-do-not-fail-if-interface-disappears-during-.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/legacy/busybox/0017-ifupdown-do-not-fail-if-interface-disappears-during-.patch b/legacy/busybox/0017-ifupdown-do-not-fail-if-interface-disappears-during-.patch
new file mode 100644
index 000000000..bdf24b783
--- /dev/null
+++ b/legacy/busybox/0017-ifupdown-do-not-fail-if-interface-disappears-during-.patch
@@ -0,0 +1,45 @@
+From 444a2f6be54186ae9ade1f2c3d4356cd62a720c5 Mon Sep 17 00:00:00 2001
+From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
+Date: Fri, 23 Mar 2018 14:56:52 +0200
+Subject: [PATCH] ifupdown: do not fail if interface disappears during ifdown
+
+Interface may not exist because it got deleted by an ifdown hook script
+earlier. This may happen when a virtual interface, such as VLAN, has multiple
+iface blocks defined.
+
+Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
+---
+ networking/ifupdown.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/networking/ifupdown.c b/networking/ifupdown.c
+index 534c9f0c7..35d13c5e1 100644
+--- a/networking/ifupdown.c
++++ b/networking/ifupdown.c
+@@ -141,6 +141,7 @@
+ #include "libbb.h"
+ #include "common_bufsiz.h"
+ /* After libbb.h, since it needs sys/types.h on some systems */
++#include <net/if.h>
+ #include <sys/utsname.h>
+ #include <fnmatch.h>
+
+@@ -503,6 +504,7 @@ static int FAST_FUNC static_up6(struct interface_defn_t *ifd, execfn *exec)
+
+ static int FAST_FUNC static_down6(struct interface_defn_t *ifd, execfn *exec)
+ {
++ if (!if_nametoindex(ifd->iface)) return 1;
+ # if ENABLE_FEATURE_IFUPDOWN_IP
+ return execute("ip link set %iface% down", ifd, exec);
+ # else
+@@ -598,6 +600,7 @@ static int FAST_FUNC static_up(struct interface_defn_t *ifd, execfn *exec)
+ static int FAST_FUNC static_down(struct interface_defn_t *ifd, execfn *exec)
+ {
+ int result;
++ if (!if_nametoindex(ifd->iface)) return 2;
+ # if ENABLE_FEATURE_IFUPDOWN_IP
+ /* Optional "label LBL" is necessary if interface is an alias (eth0:0),
+ * otherwise "ip addr flush dev eth0:0" flushes all addresses on eth0.
+--
+2.14.3
+