On 10/03/2011 03:22 PM, Laurent Bercot wrote: > > > The NTP server ip is distributed via DHCP in my case. > > So I want to do 'ntpd -p $NTP_SERVER'. > > But that variable $NTP_SERVER is empty, and also /etc/ntp.conf does not > > exist. > > > > Does anybody know where to find the NTP server's IP address received > > with 'dhcpc -O ntpsrc' ? > > If I understand the udhcpc.c code correctly, result of unknown options > listed with "-O foobar" are put into the environment via the line > ofs = sprintf(*curr, "opt%u=", i); > > So if you start your client with "udhcpc -O ntpsrv", if my guess is > correct, you should get the NTP server address in the "opt0" environment > variable. > thanks for the hint, but 'env | grep -i opt' gives nothing. I must say, the dhcp server sends out the ntp server IP address by default, so it is not necessary to ask. With wireshark, I see the DHCP offer, and it contains the NTP server IP address.
Jürgen > > -- > Laurent > -- Jürgen Lambrecht R&D Associate Tel: +32 (0)51 303045 Fax: +32 (0)51 310670 http://www.televic-rail.com Televic Rail NV - Leo Bekaertlaan 1 - 8870 Izegem - Belgium Company number 0825.539.581 - RPR Kortrijk _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
