[erlang-questions] Problems with gen_udp on multi-homed hosts

Michael Santos <>
Tue Nov 16 20:09:39 CET 2010


On Tue, Nov 16, 2010 at 01:03:18PM -0500, Gregory Haskins wrote:

> >> So the obvious solution to me after googling was to use the {ip,
> >> {192.168.122.1}} option on the open.  The open() call succeeds with this
> >> option set, but I never see any packets (even though I have sniffed the
> >> line and they are indeed being sent.  As a sanity check, I also set a
> >> bogus IP in the open(), and it does indeed exception out, so it seems
> >> like it is taking the option I set.
> > 
> > Not sure why this isn't working, maybe the packet is still going out
> > your default interface.
> 
> Well, the problem I was describing was on the RX side.  I don't seem to
> get any packets once the {ip, ..} option is set (even though my client
> is basically making requests every few seconds regardless of the
> server-side mode, and I can confirm I see the packets on the wire via
> wireshark)

Ok. Maybe confirm in wireshark that the MAC address for the packet being
sent is the one you expect (assuming virbr0 isn't a physical interface).

> >> I am running out of ideas outside of abandoning gen_udp() in favor of a
> >> ports driver, and/or not writing the DHCP portion of my code in Erlang.
> >>  Neither is particularly attractive, especially given that this seems
> >> like a fairly straight forward sockets app and I would think it could be
> >> made to work.
> > 
> > On Linux, you can try binding the socket to an interface [1].
> 
> Very cool.  I will take a look at procket.
> 
> > klaar added
> > support to do this for his quite interesting dhcp server, edhcpd [2].
> 
> Cool, I wasnt aware of this project either.  I was using code from
> http://code.google.com/p/erlang-dhcp-server as a base, but its fairly
> old now.  Perhaps I should be looking at klaar's code instead, anyway.
> 
> You mentioned he is doing some interesting things?  Out of curiosity,
> can you elaborate on what makes it interesting to you?  I noticed that
> he is using gproc and mnesia (vs dets in the project referenced above)
> so I assume at the very least this might be some kind of clustered DHCPd
> impl?  Anything else interesting going on?

To be honest, I haven't had a chance to look too closely at it, so mainly
the idea of an Erlang dhcp server :) 



More information about the erlang-questions mailing list