summaryrefslogtreecommitdiff
path: root/src/dhcp.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-04-04 06:01:07 +0200
committerMarcel Holtmann <marcel@holtmann.org>2008-04-04 06:01:07 +0200
commit45541d278519384fe25be74a196254d281012019 (patch)
tree8e411f898b07e5569efff1076a9602f674ee21ec /src/dhcp.c
parent53d969dd73a36b57bbcb705e325d2b68a2ba1e23 (diff)
downloadconnman-45541d278519384fe25be74a196254d281012019.tar.gz
connman-45541d278519384fe25be74a196254d281012019.tar.bz2
connman-45541d278519384fe25be74a196254d281012019.zip
Update state machine handling for wireless networks
Diffstat (limited to 'src/dhcp.c')
-rw-r--r--src/dhcp.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/dhcp.c b/src/dhcp.c
index ecf61f2b..3b6ba637 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -76,8 +76,13 @@ int __connman_dhcp_request(struct connman_iface *iface)
{
struct connman_dhcp_driver *driver = g_slist_nth_data(drivers, 0);
- if (driver && driver->request)
+ if (iface->flags & CONNMAN_IFACE_FLAG_DHCP)
+ return -1;
+
+ if (driver && driver->request) {
+ iface->flags |= CONNMAN_IFACE_FLAG_DHCP;
return driver->request(iface);
+ }
return -1;
}
@@ -86,8 +91,13 @@ int __connman_dhcp_release(struct connman_iface *iface)
{
struct connman_dhcp_driver *driver = g_slist_nth_data(drivers, 0);
- if (driver && driver->release)
+ if (!(iface->flags & CONNMAN_IFACE_FLAG_DHCP))
+ return -1;
+
+ if (driver && driver->release) {
+ iface->flags &= ~CONNMAN_IFACE_FLAG_DHCP;
return driver->release(iface);
+ }
return -1;
}