where I run timed -n test-net to force timed to only bind to a specific network I get the following error timed: no network usable Since my /etc/networks file has the correct infos in it. I dig into the source code... The problem was nail down to the following lines of the timed source code timed.c line 393 nt->net = htonl(nt->net); This seems to do nothing (nt->net doesn't change), which suprised me since I'm on a little endian architecture (i686). So I wrote the following test program : #include <netdb.h> #include <stdio.h> #include <netinet/in.h> int main ( int argc, char *argv[]) { struct netent *net; unsigned long haddr,naddr; if ( argc != 2 ) { fprintf( stderr, "usage: test <net>\n" ); exit(2); } net = getnetbyname( argv[1] ); if ( !net) { fprintf( stderr, "no such network: %s\n", argv[1] ); exit(1); } haddr = net->n_net; naddr = htonl(haddr); printf( "Network in host byte order: %lu\n", haddr); printf( "Network in network byte order: %lu\n", naddr); exit(0); } Which when is compiled either as gcc -O2 -o test test.c or gcc -o test test.c gives the same uncomprehensible result. (/etc/networks contains) 192.168.250.0 test-net $ ./test test-net Network in host byte order: 4294967295 Network in network byte order: 4294967295
With the /etc/networks line jbj-net 198.178.231 your test program produced (I like hex output) porkchop:~ 1028 bash$ ./n jbj-net Network in host byte order: c6b2e7 Network in network byte order: e7b2c600 correctly on a i686 little-endian machine. Please reopen this bug with better info regarding timed. I'd suggest that you look seriously at xntp3 rather than timed if you are interested in distributing a reference time reliably.