lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Thu, Nov 12, 2009 at 1:17 PM, Doug Rogers
<> wrote:
> Clark Snowdall wrote:
> Also, for me udp:setpeername() fails under Linux when I use 'localhost'
> in setsockname(). I have to set the host variable to be the local IP
> address on the Ethernet interface (to which I want to send). I'm not
> sure why this is so - perhaps use INADDR_ANY rather than 'localhost'?

localhost isn't mapped to automatically, it happens because
localhost is in /etc/hosts:

% grep localhost /etc/hosts       localhost
::1     ip6-localhost ip6-loopback

Also, some DNS server setups map it that way.

> If these are not your problems, then I'm at a loss. I was able to
> capture the subnet broadcast packet using Wireshark; it's Ethernet
> address was broadcast. I set the filter to 'udp port 47808' and made the
> mods mentioned above.

Clark, is it possible the subnet mask is not, as your
bcast address assumes?

ifconfig will tell you the bcast address, mine says this:

eth0      Link encap:Ethernet  HWaddr 00:16:17:75:D4:DA
          inet addr:  Bcast:  Mask:

By default, the netmask for the 10.* IP addresses is 8, so your bcast
addr would be, but its probably set to something else.