1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-27 10:25:06 +03:00

dhcp: Add function to free DHCP client data

This commit is contained in:
Patrik Flykt 2013-12-09 23:43:32 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 751246ee37
commit d2fe46b514
2 changed files with 14 additions and 0 deletions

View File

@ -961,6 +961,19 @@ int sd_dhcp_client_stop(sd_dhcp_client *client)
return client_stop(client, DHCP_EVENT_STOP);
}
sd_dhcp_client *sd_dhcp_client_free(sd_dhcp_client *client)
{
assert_return(client, NULL);
sd_dhcp_client_stop(client);
sd_event_unref(client->event);
free(client->req_opts);
free(client);
return NULL;
}
sd_dhcp_client *sd_dhcp_client_new(sd_event *event)
{
sd_dhcp_client *client;

View File

@ -57,6 +57,7 @@ int sd_dhcp_client_get_router(sd_dhcp_client *client, struct in_addr *addr);
int sd_dhcp_client_stop(sd_dhcp_client *client);
int sd_dhcp_client_start(sd_dhcp_client *client);
sd_dhcp_client *sd_dhcp_client_free(sd_dhcp_client *client);
sd_dhcp_client *sd_dhcp_client_new(sd_event *event);
#endif