Commit ba2cb98a authored by Gabriel Kerneis's avatar Gabriel Kerneis Committed by Juliusz Chroboczek

Announce hostname on local interface.

Use the hostname instead of "alamakota" when announcing the router
on the local interface.  It would make it possible for visualisation
tools, such as babelweb, to display a meaningful name automatically.
parent e097312d
......@@ -91,13 +91,19 @@ void
local_notify_self()
{
char buf[512];
char host[64];
int rc;
if(local_socket < 0)
return;
rc = snprintf(buf, 512, "add self alamakota id %s\n",
format_eui64(myid));
rc = gethostname(host, 64);
if(rc < 0)
strncpy(host, "alamakota", 64);
rc = snprintf(buf, 512, "add self %64s id %s\n",
host, format_eui64(myid));
if(rc < 0 || rc >= 512)
goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment