(hostinfo-addresses (hostname->hostinfo (get-host-name)))))) => returns only one address

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

(hostinfo-addresses (hostname->hostinfo (get-host-name)))))) => returns only one address

Matt Welland-3
There are three interfaces on the host but hostinfo-addresses returns only one. I think this may be a bug.

I'm using chicken 4.13 and see the same behavior on Ubuntu 18.04 and SLES11.

csi> (hostinfo-addresses (hostname->hostinfo (get-host-name)))
#(#u8(10 27 44 127))

Sometimes I get 127.0.0.1, sometimes I get one of the external interfaces.

BTW, I don't see a hostinfo egg for Chicken 5. Is porting hostinfo planned or is the functionality available in a different egg?

Thanks.
--
Complexity is your enemy. Any fool can make something complicated.
It is hard to keep things simple. - Richard Branson.

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: (hostinfo-addresses (hostname->hostinfo (get-host-name)))))) => returns only one address

Vasilij Schneidermann-2
Hello Matt,

> BTW, I don't see a hostinfo egg for Chicken 5. Is porting hostinfo planned
> or is the functionality available in a different egg?

There is no such thing as a grand plan to port all the eggs, it's been
done so far on a case-by-case basis.  If someone really needs an egg,
they'll port it and notify the author or maintainer of the required
changes.  Some authors and maintainers are proactive about it and port
all of their eggs, but that's apparently not the case for this one.

Looking further at it, it appears it was written by Jim Ursetto who put
up some ported eggs on https://github.com/ursetto recently, but not that
one yet.  From personal experience porting his eggs is challenging due
to use of macros, internal stuff and other trickery.  This one doesn't
look too bad though, I could give it a try if you like.

Vasilij

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: (hostinfo-addresses (hostname->hostinfo (get-host-name)))))) => returns only one address

Matt Welland-3
Hi Vasilij,

While it would be great if you decided to port hostinfo, note that unfortunately with the hostinfo-addresses bug it is not much use to me. We have some code that seems to work ok for now: http://www.kiatoa.com/cgi-bin/fossils/ulex/artifact/5fd65e8732654017 so I am not blocked by this. I was hoping to leverage an existing egg but that is not critical. If Jim Ursertto sees this perhaps he can comment on his plans.

Thanks,

Matt

On Sat, Jul 20, 2019 at 12:30 AM Vasilij Schneidermann <[hidden email]> wrote:
Hello Matt,

> BTW, I don't see a hostinfo egg for Chicken 5. Is porting hostinfo planned
> or is the functionality available in a different egg?

There is no such thing as a grand plan to port all the eggs, it's been
done so far on a case-by-case basis.  If someone really needs an egg,
they'll port it and notify the author or maintainer of the required
changes.  Some authors and maintainers are proactive about it and port
all of their eggs, but that's apparently not the case for this one.

Looking further at it, it appears it was written by Jim Ursetto who put
up some ported eggs on https://github.com/ursetto recently, but not that
one yet.  From personal experience porting his eggs is challenging due
to use of macros, internal stuff and other trickery.  This one doesn't
look too bad though, I could give it a try if you like.

Vasilij


--
--
Complexity is your enemy. Any fool can make something complicated.
It is hard to keep things simple. - Richard Branson.

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: (hostinfo-addresses (hostname->hostinfo (get-host-name)))))) => returns only one address

Vasilij Schneidermann-2
Hello Matt,

Turns out this wasn't that hard to port.  I've added Jim to Cc so that
he can take a look at the patch.

Unfortunately I don't know much about this networking thing, so I can't
help you with the bug, other than giving you debugging ideas.  Take a
look at how exactly the egg performs its lookups and compare it with
your own solution.  Maybe there's a crucial thing missing in the egg or
something.  Another thing that would help would be having a publicly
reachable host at hand that always returns multiple addresses.

Vasilij

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users

0001-C5-compatibility.patch (2K) Download Attachment
signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: (hostinfo-addresses (hostname->hostinfo (get-host-name)))))) => returns only one address

Vasilij Schneidermann-2
In reply to this post by Matt Welland-3
For some reason putting Jim into Cc didn't work, so I'm trying it the
other way.  Once again, a patch for porting hostinfo to C5.

Vasilij

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users

0001-C5-compatibility.patch (2K) Download Attachment
signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: (hostinfo-addresses (hostname->hostinfo (get-host-name)))))) => returns only one address

Vasilij Schneidermann-2
In reply to this post by Matt Welland-3
One more time, with a patch for Jim.

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users

0001-C5-compatibility.patch (2K) Download Attachment
signature.asc (499 bytes) Download Attachment