diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-08-16 20:39:52 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-08-16 20:39:52 +0200 |
commit | b11be131b73fd47e12b1a9f1c52ac0a1ed222aee (patch) | |
tree | 54f66073eba3ce1bd4e9d20d3e4fbc1fe1bc7248 | |
parent | 110c6bb413ff7363e9b453edef8ae11cf7b64404 (diff) | |
download | busybox-w32-b11be131b73fd47e12b1a9f1c52ac0a1ed222aee.tar.gz busybox-w32-b11be131b73fd47e12b1a9f1c52ac0a1ed222aee.tar.bz2 busybox-w32-b11be131b73fd47e12b1a9f1c52ac0a1ed222aee.zip |
ifplugd: if SIOCSIFFLAGS fails with ENODEV, don't die
Some user managed to hit a race where iface is gone between SIOCGIFFLAGS
and SIOCSIFFLAGS (!). If SIOCSIFFLAGS fails, treat it the same as failed
SIOCGIFFLAGS
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/ifplugd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/networking/ifplugd.c b/networking/ifplugd.c index 28c49e218..029cba147 100644 --- a/networking/ifplugd.c +++ b/networking/ifplugd.c | |||
@@ -358,8 +358,12 @@ static void up_iface(void) | |||
358 | ifrequest.ifr_flags |= IFF_UP; | 358 | ifrequest.ifr_flags |= IFF_UP; |
359 | /* Let user know we mess up with interface */ | 359 | /* Let user know we mess up with interface */ |
360 | bb_error_msg("upping interface"); | 360 | bb_error_msg("upping interface"); |
361 | if (network_ioctl(SIOCSIFFLAGS, &ifrequest, "setting interface flags") < 0) | 361 | if (network_ioctl(SIOCSIFFLAGS, &ifrequest, "setting interface flags") < 0) { |
362 | xfunc_die(); | 362 | if (errno != ENODEV) |
363 | xfunc_die(); | ||
364 | G.iface_exists = 0; | ||
365 | return; | ||
366 | } | ||
363 | } | 367 | } |
364 | 368 | ||
365 | #if 0 /* why do we mess with IP addr? It's not our business */ | 369 | #if 0 /* why do we mess with IP addr? It's not our business */ |