<div class="gmail_quote">On Mon, Apr 25, 2011 at 9:31 PM, John Koenig <span dir="ltr"><<a href="mailto:koenigjm@acalledshot.org">koenigjm@acalledshot.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">
I have experienced an issue on newer versions of Ubuntu Desktop
(10.04 and later) when trying to send messages from an erlang VM to
a C node which is using ei. My procedure is as follows (shadow is
the hostname of the machine I am currently testing on):<br>
<br>
1) Start an erlang VM (thus starting empd in the process): erl
-sname test@localhost -setcookie dev<br>
<br>
2) Start the C node, in this case the C node will bind to
localhost:30000 with a published name of "cnode" using "dev" as its
secret cookie: ./my_cnode -P 30000 -N cnode -S dev<br>
<br>
3) Attempt to send a message from erlang to C Node: {any,
cnode@localhost} ! {call, self(), {echo}}.<br>
<br>
Step 3 results in the following error:<br>
<blockquote>Error in process <0.43.0> on node 'test@localhost'
with exit value:
{badarg,[{erlang,list_to_existing_atom,["cnode@shadow"]},{dist_util,recv_challenge,1},{dist_util,handshake_we_started,1}]}<br>
</blockquote>
My /etc/hosts file contains:<br>
<blockquote>127.0.0.1 localhost<br>
127.0.1.1 shadow<br>
<br>
# The following lines are desirable for IPv6 capable hosts<br>
::1 ip6-localhost ip6-loopback<br>
fe00::0 ip6-localnet<br>
ff00::0 ip6-mcastprefix<br>
ff02::1 ip6-allnodes<br>
ff02::2 ip6-allrouters<br>
</blockquote>
If I change the 127.0.0.1 entry to "127.0.0.1 localhost shadow" and
comment out the second line, then communication between the VM and C
node succeeds. What is happening here? Is there a way to achieve
communication over localhost without having to change /etc/hosts?<br></div></blockquote><div><br></div><div>Can you ping "shadow" while it is associated to the IP 127.0.1.1 ? </div><div>If you've blocked ICMP echo in kernel, enable it temporarily and test.</div>
<div>If ping works, try to write a small program to do a reverse name-resolution in C and see if it works.</div></div>