[oe-commits] [openembedded-core] 02/02: busybox: using ip instead of ifconfig for ifup/ifdown

git at git.openembedded.org git at git.openembedded.org
Wed Sep 13 10:21:13 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit c80cbe920b64b79b2e4922f43ed8ce5626d2e716
Author: Yi Zhao <yi.zhao at windriver.com>
AuthorDate: Wed Sep 13 14:01:07 2017 +0800

    busybox: using ip instead of ifconfig for ifup/ifdown
    
    There is an issue for requesting dynamic IP with ifup/ifdown command
    when using dhclient.
    
    Steps to reproduce:
    1. Build a full-cmdline image and install dhcp-client as the default DHCP client.
    2. Configure a static IP for eth0 in /etc/networking/interfaces and reboot.
        $ ifconfig eth0
        eth0      inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
        $ ifdown eth0
    3. Modify /etc/networking/interfaces to configure a dynamic IP for eth0
        $ ifup eth0
        $ ifconfig eth0
        eth0      inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
    
    You could see the eth0 still has a static IP. But actually it also has a
    dynamic IP:
        $ ip addr show eth0
        eth0:
            inet 192.168.1.2/24 brd 192.168.1.255 scope global eth0
            inet 128.224.162.173/23 brd 128.224.163.255 scope global eth0
    
    The root cause is the ifdown invokes "ifconfig" to down the eth0 but
    doesn't remove its IP. The dhclient would invoke "ip" to configure the
    interface. It can not remove an IP from down interface with "ip addr
    flush" and "ip addr add" command can set multiple IPs on one interface.
    
    To fix this issue, we should use the "ip" command to implement
    ifup/ifdown, rather than using the older "ifconfig". It will flush the
    IP before down the interface.
    
    Signed-off-by: Yi Zhao <yi.zhao at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-core/busybox/busybox/defconfig | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/busybox/busybox/defconfig b/meta/recipes-core/busybox/busybox/defconfig
index 54202ef..cc68bea 100644
--- a/meta/recipes-core/busybox/busybox/defconfig
+++ b/meta/recipes-core/busybox/busybox/defconfig
@@ -820,9 +820,9 @@ CONFIG_FEATURE_IFCONFIG_HW=y
 # CONFIG_IFPLUGD is not set
 CONFIG_IFUPDOWN=y
 CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
-# CONFIG_FEATURE_IFUPDOWN_IP is not set
-# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set
-CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN=y
+CONFIG_FEATURE_IFUPDOWN_IP=y
+CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y
+# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set
 CONFIG_FEATURE_IFUPDOWN_IPV4=y
 CONFIG_FEATURE_IFUPDOWN_IPV6=y
 CONFIG_FEATURE_IFUPDOWN_MAPPING=y

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list