How to disconnect correctly?

michael kapelko kornerr at
Thu Jan 20 09:40:53 UTC 2011

I tried to search for the topic, but found no answer.

I need to continuously connect to and disconnect from DHCP server. I
need it to implement lease drop upon receiving link down trap from
I tried to just connect and then change "ends" property of lease, but
that single connection crashes my app when DHCP server goes down. And
there's no way to check if DHCP server is up.
I tried to disconnect with omapi_disconnect(dhcpctl_handle*) call, but
it said "invalid argument".
I tried to "disconnect" with omapi_object_dereference(dhcpctl_handle*,
1). It said nothing, but it didn't help.
The latter 2 cases after about 5 minutes I start to get "not enough
free resources" error upon "dhcpctl_connect" call.
So how to disconnect correctly?

More information about the dhcp-users mailing list