[ntp:bugs] [Bug 1862] Compilation error, ntp_io.c:1678: undefined reference to `in6addr_any'

bugzilla-daemon at ntp.org bugzilla-daemon at ntp.org
Mon Mar 28 12:33:13 UTC 2011


http://bugs.ntp.org/show_bug.cgi?id=1862

--- Comment #6 from Stefan olsson <misca at hotmail.com> 2011-03-28 12:33:13 UTC ---
Hi


I am using the --enable-share and --enable-static but it did not lead anywhere.


I ned some help to clarify the code and the intention a little more.

the linker complain on 

env CSET=`cat ../sntp/scm-rev` ../scripts/mkver ntpd
Version <ntpd 4.2.7p142 at 1.2509-o Mon Mar 28 09:51:24 UTC 2011 (1)>
env CCACHE_DISABLE=1 gcc -DHAVE_CONFIG_H -I. -I..  -I../include
-I../lib/isc/include -I../lib/isc/pthreads/include -I../lib/isc/unix/include
-I../sntp/libopts -I/ffp/include  -ffunction-sections -fdata-sections -Wall
-Wcast-align -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow
-Winit-self   -Wno-strict-prototypes -g -O2 -c version.c -o version.o
  CCLD   ntpd
../libntp/libntp.a(file.o): In function `isc_file_settime':
/ffp/install/ntp-4.2.7p142-bug1861/libntp/./../lib/isc/unix/file.c:153:
warning: the use of LEGACY `utimes' is discouraged, use `utime'
../libntp/libntp.a(interfaceiter.o): In function `linux_if_inet6_current':
/ffp/install/ntp-4.2.7p142-bug1861/libntp/./../lib/isc/unix/interfaceiter.c:272:
undefined reference to `in6addr_any'


If I look closer to function linux_if_inet6_current in file
./lib/isc/unix/interfaceiter.c it declare a struct on line 192, struct ifreq
ifreq;


Question 1:
The only definition on a struct ifreq that I can find among all the files is in
file ./include/ntif.h, is this correct file or is this struct defined somewhere
else ?



Also:
./include/ntif.h is a little bit strange, it seems that this file is not
included in any .c or .h file at all, perhaps it could be removed


Should not the #include <winsock.h> in ./include/ntif.h
be guarded by 
#if defined (SYS_WINNT) || defined (SYS_VXWORKS) || defined SYS_CYGWIN32
...
#endif

or 

#if defined SYS_WINNT || defined SYS_CYGWIN32
...
#endif




##### A Suggested solution

The following might be a solution that could work without breaking breaking the
legacy, also, the changes should be in line with the consisty of guarding ipv6
code with #ifdef


In file ./lib/isc/unix/ifiter_sysctl.c

Guard the lines 488 and 706 with

#ifdef INCLUDE_IPV6_SUPPORT
..
#endif

but keep the return (ISC_R_IGNORE); outside the guard

In the same way that, for example, ./ntpd/ntp_io.c (line 1123) is done


Also, guard lines 329 to 363 in file ./sntp/main.c with 

#ifdef INCLUDE_IPV6_SUPPORT
..
..
#endif


/Stefan

-- 
Configure bugmail: http://bugs.ntp.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the bugs mailing list