doubt in the code

Pavel Roskin proski at gnu.org
Mon Mar 23 20:49:17 EDT 2009


On Fri, 2009-03-20 at 11:56 +0530, PrameelaRani wrote:
> Hi,
> I have started going through the hostapd code recently. I have a doubt 
> in the main() function in hostapd.c.
> After the interfaces are successfully initialized, ret value is set to 0 
> and from there you have to return from the function right???

No.  hostapd_global_run() is called before ret is set to 0.

> Why are you proceeding to label 'out' where it deinitializes all the 
> interfaces and undo all registrations.

This is done if hostapd_interface_init() failed for any interface or if
hostapd_global_run() returned a non-zero code.

You can run hostapd in gdb to see which code is executed.  For best
results, compile hostapd without optimization.

-- 
Regards,
Pavel Roskin


More information about the HostAP mailing list