where do I find the NTP server address with 'dhcpc -O ntpsrv' - bug found
Lambrecht Jürgen
J.Lambrecht at TELEVIC.com
Wed Oct 5 09:46:47 UTC 2011
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.
>
Indeed, but there are bugs in the code.
For the 256 options, only 32 bits are allocated, and 1<<42 assignments
to an unsigned happen..
I fixed the bugs, and will try today if it works.
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
More information about the busybox
mailing list