From 250b52f6737c253a2b6ff3dd5804afbe3d0cfce0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 12 Feb 2010 02:06:57 +0000 Subject: [PATCH] base-files: revert dhcp state information on ifdown and restore pre-r19530 behaviour in udhcp default.script SVN-Revision: 19597 --- package/base-files/Makefile | 2 +- package/base-files/files/lib/network/config.sh | 5 +++++ package/base-files/files/usr/share/udhcpc/default.script | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index fa0711fe2a..5cd87a66f5 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=base-files -PKG_RELEASE:=38 +PKG_RELEASE:=39 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh index 12b08a29ff..b7d7b259a9 100755 --- a/package/base-files/files/lib/network/config.sh +++ b/package/base-files/files/lib/network/config.sh @@ -327,6 +327,11 @@ setup_interface() { } } +stop_interface_dhcp() { + local config="$1" + uci -P /var/state revert "network.$config" +} + unbridge() { local dev="$1" local brdev diff --git a/package/base-files/files/usr/share/udhcpc/default.script b/package/base-files/files/usr/share/udhcpc/default.script index f704a7bf29..b32b2c9f25 100755 --- a/package/base-files/files/usr/share/udhcpc/default.script +++ b/package/base-files/files/usr/share/udhcpc/default.script @@ -31,8 +31,7 @@ setup_interface () { config_get old_subnet "$ifc" netmask } - [ "$1" = "ifup" ] \ - || [ "$ip" != "$old_ip" ] \ + [ "$ip" != "$old_ip" ] \ || [ "${broadcast:-+}" != "$old_broadcast" ] \ || [ "${subnet:-255.255.255.0}" != "$old_subnet" ] && { echo "udhcpc: ifconfig $interface $ip netmask ${subnet:-255.255.255.0} broadcast ${broadcast:-+}" -- 2.25.1