From 7238072a7da527147c21cc939160d975eb28b1ac Mon Sep 17 00:00:00 2001 From: TK MUN Date: Sun, 20 Mar 2011 11:42:49 +0900 Subject: [PATCH] DO NOT MERGE Change IP renew service name - Change invalid service name (dhcpcd_renew -> iprenew) - Remove condition which checks status of renew service. - Remove unused variable. Change-Id: Ic4ae7fb950baf4bd7286088a945a48ab5fe64e91 --- libnetutils/dhcp_utils.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/libnetutils/dhcp_utils.c b/libnetutils/dhcp_utils.c index 13c51d7ce..dc71bab2a 100644 --- a/libnetutils/dhcp_utils.c +++ b/libnetutils/dhcp_utils.c @@ -28,9 +28,7 @@ static const char DAEMON_NAME[] = "dhcpcd"; static const char DAEMON_PROP_NAME[] = "init.svc.dhcpcd"; static const char HOSTNAME_PROP_NAME[] = "net.hostname"; static const char DHCP_PROP_NAME_PREFIX[] = "dhcp"; -static const char DAEMON_NAME_RENEW[] = "dhcpcd_renew"; -static const char DAEMON_PROP_NAME_RENEW[] = "init.svc.dhcpcd_renew"; -static const char DHCP_PROP_NAME_RENEW_PREFIX[] = "dhcp_renew"; +static const char DAEMON_NAME_RENEW[] = "iprenew"; static const int NAP_TIME = 1; /* wait for 1 second at a time */ /* when polling for property values */ static char errmsg[100]; @@ -254,18 +252,12 @@ int dhcp_do_request_renew(const char *interface, uint32_t *lease) { char result_prop_name[PROPERTY_KEY_MAX]; - char daemon_prop_name[PROPERTY_KEY_MAX]; char prop_value[PROPERTY_VALUE_MAX] = {'\0'}; char daemon_cmd[PROPERTY_VALUE_MAX * 2]; const char *ctrl_prop = "ctl.start"; - const char *desired_status = "running"; snprintf(result_prop_name, sizeof(result_prop_name), "%s.%s.result", - DHCP_PROP_NAME_RENEW_PREFIX, - interface); - - snprintf(daemon_prop_name, sizeof(daemon_prop_name), "%s_%s", - DAEMON_PROP_NAME_RENEW, + DHCP_PROP_NAME_PREFIX, interface); /* Erase any previous setting of the dhcp result property */ @@ -275,10 +267,6 @@ int dhcp_do_request_renew(const char *interface, snprintf(daemon_cmd, sizeof(daemon_cmd), "%s_%s:%s", DAEMON_NAME_RENEW, interface, interface); memset(prop_value, '\0', PROPERTY_VALUE_MAX); property_set(ctrl_prop, daemon_cmd); - if (wait_for_property(daemon_prop_name, desired_status, 10) < 0) { - snprintf(errmsg, sizeof(errmsg), "%s", "Timed out waiting for dhcpcd Renew to start"); - return -1; - } /* Wait for the daemon to return a result */ if (wait_for_property(result_prop_name, NULL, 30) < 0) {