Implementation of ether_line, ether_hostton and ether_ntohost

Carmelo AMOROSO carmelo.amoroso at
Wed Feb 27 13:54:21 UTC 2008

Carmelo Amoroso wrote:
> Carmelo Amoroso wrote:
>> Matthew Wilcox wrote:
>>> I want to be able to etherwake by hostname.  Since I've gone to the
>>> trouble of putting that information in /etc/ethers, I think my computer
>>> should jolly well not force me to type in meaningless strings of hex.
>>> So here's an implementation (ethers.c) and two test programs
>>> (ethers-line-test.c and ethers-test.c) which exercise it a little.
>>> I'm not sure how to integrate all this into your build framework; seems
>>> to me you guys would be the experts at that ;-)
>>> I hope you find my contribution useful.
>> Let me see.... indeed I'm interested into etherwake too
>> Cheers,
>> Carmelo
> Hello,
> I've just added your implementation (with test-cases) into my 
> uClibc-nptl tree for SH4.
> Test failed taking a SGBUS due to unaligned access.
> I'll see what is going wrong and fix if needed. Then I'l go ahead and 
> commit it.
> Thanks,
> Carmelo
the problem was in the incorrect file name used into the test file
("ethers" instead of "/etc/ethers"). Moreover the test was missing
of proper error checks (file not found, map failed ad so on).
I hacked a bit these to make them more robust.
I've built and tested them linking against glibc using the same
/etc/ethers sample file with different behavior.

ether_line in uclibc prints the first line only
while glibc prints all the content of the file,
so I think further check on ether_line implementation need to be done.

Can you try on your platform putting more then one line into /etc/ethers ?
let me know.


More information about the uClibc mailing list