[PATCH 1/3] defaultenv-2 ifup: Always overwrite eth0.serverip

Sascha Hauer s.hauer at pengutronix.de
Thu Jun 7 16:37:34 EDT 2012


if serverip is specified, also overwrite eth0.serverip in dhcp
case. This makes it possible to specify a different serverip
when the dhcp server returns the wrong ip (because the DHCP
might be a DSL router which does not provide tftp).

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 defaultenv-2/base/bin/ifup |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/defaultenv-2/base/bin/ifup b/defaultenv-2/base/bin/ifup
index 9f6fd6b..ed33b06 100644
--- a/defaultenv-2/base/bin/ifup
+++ b/defaultenv-2/base/bin/ifup
@@ -53,7 +53,12 @@ if [ "$ip" = static ]; then
 	${interface}.gateway=$gateway
 elif [ "$ip" = dhcp ]; then
 	dhcp
-	exit $?
+	ret=$?
+	if [ $ret = 0 -a -n "$serverip" ]; then
+		${interface}.serverip=$serverip
+	fi
+
+	exit $ret
 fi
 
 echo -o /tmp/network/$interface up
-- 
1.7.10




More information about the barebox mailing list