File 0013-Fixed-ifrenew-dhcp-to-use-built-in-dhcpcd-renew.patch of Package sysconfig.openSUSE_12.1_Update

From b7054f1aab5d3e555aa95a6ebdc10bbed21a0f92 Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.com>
Date: Wed, 23 May 2012 16:39:56 +0200
Subject: [PATCH] Fixed ifrenew-dhcp to use built-in dhcpcd --renew


Signed-off-by: Marius Tomaschewski <mt@suse.com>
---
 scripts/ifup-dhcp |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/scripts/ifup-dhcp b/scripts/ifup-dhcp
index 368f4d2..c235b14 100755
--- a/scripts/ifup-dhcp
+++ b/scripts/ifup-dhcp
@@ -291,6 +291,8 @@ esac
 
 
 start_dhcp4_dhcpcd() {
+	renew=$1
+
 	#
 	# Using netconfig, we can request all options and
 	# netconfig takes care to apply them properlly...
@@ -332,10 +334,10 @@ start_dhcp4_dhcpcd() {
 	args="$args${DHCLIENT_VENDOR_CLASS_ID:+ -i \"$DHCLIENT_VENDOR_CLASS_ID\"}"
 	args="$args${DHCLIENT_LEASE_TIME:+ -l \"$DHCLIENT_LEASE_TIME\"}"
 	args="$args${DHCLIENT_HOSTNAME_OPTION:+ -h \"$DHCLIENT_HOSTNAME_OPTION\"}"
-	debug "Starting dhcp client: $DHCLIENT_BIN $DHCPCD_USER_OPTIONS $args $INTERFACE"
+	debug "Starting dhcp client: $DHCLIENT_BIN $renew $DHCPCD_USER_OPTIONS $args $INTERFACE"
 
 	# now start dhcpcd
-	$DHCLIENT_BIN $DHCPCD_USER_OPTIONS $DHCLIENT_ARGS \
+	$DHCLIENT_BIN $renew $DHCPCD_USER_OPTIONS $DHCLIENT_ARGS \
 		${DHCLIENT_TIMEOUT:+-t "$DHCLIENT_TIMEOUT"}                 \
 		${DHCLIENT_CLIENT_ID:+-I "$DHCLIENT_CLIENT_ID"}             \
 		${DHCLIENT_VENDOR_CLASS_ID:+-i "$DHCLIENT_VENDOR_CLASS_ID"} \
@@ -632,14 +634,17 @@ case "$ACTION" in
 					# reset dhcp4 status
 					DHCP4_STATUS=""
 					case "$DHCLIENT" in
-					(dhcpcd|dhclient)
+					(dhcpcd) ;;
+					(dhclient)
+						DHCP4_STATUS=""
 						$DHCLIENT_BIN -x $INTERFACE
+						sleep 1
+						for i in `dhcpc4_on_iface`; do
+							kill -TERM $i &>/dev/null
+						done
+						sleep 1
 					;;
 					esac
-					for i in `dhcpc4_on_iface`; do
-						kill -TERM $i &>/dev/null
-					done
-					sleep 1
 				;;
 				(dhcp6)
 					# reset dhcp6 status
@@ -710,7 +715,8 @@ case "$ACTION" in
 					case "$DHCLIENT" in
 					(dhcpcd)
 						test -n "$DHCP4_STATUS" || {
-							start_dhcp4_dhcpcd && {
+							test "$ACTION" = renew && renew='--renew' || renew=''
+							start_dhcp4_dhcpcd $renew && {
 								DHCP4_STARTED="yes"
 								write_cached_config_data dhcp4_client $DHCLIENT  $INTERFACE
 								write_cached_config_data dhcp4_state  started    $INTERFACE
-- 
1.7.7

openSUSE Build Service is sponsored by