diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-04-04 06:01:07 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-04-04 06:01:07 +0200 |
commit | 45541d278519384fe25be74a196254d281012019 (patch) | |
tree | 8e411f898b07e5569efff1076a9602f674ee21ec /src/dhcp.c | |
parent | 53d969dd73a36b57bbcb705e325d2b68a2ba1e23 (diff) | |
download | connman-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.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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; } |