Bug 8601 - ifdown doesn't work if dhcp client is not running
Summary: ifdown doesn't work if dhcp client is not running
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: 1.24.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-13 08:33 UTC by Davide
Modified: 2016-01-13 08:33 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Davide 2016-01-13 08:33:11 UTC
I have configured the wlan0 interface to work with wpa_supplicant and udhcpc. In case of wrong wireless key, the dhcp client terminate so when I try to force the shutdown of the interface, the command ifdown exit with status 1. And then the daemon wpa_supplicant still active because the scripts inside if-post-down.d aren't executed.

To solve the problem in file ifupdown.c I have modified the command line for stopping the dhcp client. In this case if the pid file is not present the kill command is not executed and the return value is correct. The modification is for both external dhcpc and udhcpc

test ! -f /var/run/udhcpc.%iface%.pid || kill `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null