*
* Connection Manager
*
- * Copyright (C) 2007-2009 Intel Corporation. All rights reserved.
+ * Copyright (C) 2007-2010 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
#define CONNMAN_API_SUBJECT_TO_CHANGE
#include <connman/plugin.h>
+#include <connman/utsname.h>
#include <connman/dhcp.h>
#include <connman/task.h>
#include <connman/log.h>
connman_dhcp_set_value(dhcp, "Timeserver", value);
} else if (g_ascii_strcasecmp(key, "new_interface_mtu") == 0) {
connman_dhcp_set_value(dhcp, "MTU", value);
+ } else if (g_ascii_strcasecmp(key, "new_proxy_auto_config") == 0) {
+ connman_dhcp_set_value(dhcp, "PAC", value);
}
dbus_message_iter_next(&dict);
char *ifname;
};
+static void dhclient_unlink(const char *ifname)
+{
+ char *pathname;
+
+ pathname = g_strdup_printf("%s/dhclient.%s.pid",
+ STATEDIR, ifname);
+ unlink(pathname);
+ g_free(pathname);
+
+ pathname = g_strdup_printf("%s/dhclient.%s.leases",
+ STATEDIR, ifname);
+ unlink(pathname);
+ g_free(pathname);
+}
+
static void dhclient_died(struct connman_task *task, void *user_data)
{
struct dhclient_data *dhclient = user_data;
+ connman_dhcp_set_data(dhclient->dhcp, NULL);
+
connman_dhcp_unref(dhclient->dhcp);
connman_task_destroy(dhclient->task);
dhclient->task = NULL;
+ dhclient_unlink(dhclient->ifname);
+
g_free(dhclient->ifname);
g_free(dhclient);
}
connman_task_add_argument(task, "-n", NULL);
}
-static void dhclient_unlink(const char *ifname)
-{
- char *pathname;
-
- pathname = g_strdup_printf("%s/dhclient.%s.pid",
- STATEDIR, ifname);
- unlink(pathname);
- g_free(pathname);
-
- pathname = g_strdup_printf("%s/dhclient.%s.leases",
- STATEDIR, ifname);
- unlink(pathname);
- g_free(pathname);
-}
-
static int dhclient_request(struct connman_dhcp *dhcp)
{
struct dhclient_data *dhclient;
DBG("dhcp %p", dhcp);
- if (dhclient->task != NULL)
- connman_task_stop(dhclient->task);
+ if (dhclient == NULL)
+ return -ESRCH;
- dhclient_unlink(dhclient->ifname);
+ connman_task_stop(dhclient->task);
return 0;
}
static struct connman_dhcp_driver dhclient_driver = {
.name = "dhclient",
+ .priority = CONNMAN_DHCP_PRIORITY_LOW,
.request = dhclient_request,
.release = dhclient_release,
};