[haiku-development] Re: DHCP and binding to a non-configured interface.

Axel Dörfler wrote:

I tried the obvious things like removing the bind call (does not work as we need a local port and I am not sure we can somehow use SO_ BINDTODEVICE to bind to a specific port) or setting SO_REUSEADDR on the socket (which is obviously a hack but, interesting enough, resulted in the same error which was unexpected).

I would guess you also need to specify SO_REUSEPORT.
Any luck with that one?

It worked (tested in VMWare with 2 interfaces as I am at work). Which is funny cause I had the impression they were basically synonyms to each other. Thanks for the heads up.

(Actually, just found out that they are synonyms only when a multicast address is used, which is not the case here.)

So, to make a long story short, how does one bind to a device (specifying a port) directly using the Haiku stack? if there is no way to do that, the solution will be to serialize interface configuration.

That should definitely be avoided.

And it was, thanks to you. :)

-Bruno


Other related posts: