Clean up the IPv6 auto-configuration daemon
Daniel Hokka Zakrisson [Thu, 26 Jul 2007 19:00:23 +0000 (19:00 +0000)]
Makefile.in
config.h.in
configure
configure.ac
distrib/Makefile.in
src/Makefile-files
src/vip6-autod.c
util-vserver.spec

index 7a927cb..e5222cc 100644 (file)
@@ -82,7 +82,7 @@ sbin_PROGRAMS = src/exec-cd$(EXEEXT) src/lsxid$(EXEEXT) \
        src/vuname$(EXEEXT) src/vsh$(EXEEXT) src/vwait$(EXEEXT) \
        src/ncontext$(EXEEXT) src/nattribute$(EXEEXT) \
        src/naddress$(EXEEXT) src/vdevmap$(EXEEXT) $(am__EXEEXT_11) \
-       $(am__EXEEXT_12)
+       $(am__EXEEXT_12) $(am__EXEEXT_13)
 noinst_PROGRAMS = tests/escaperoot$(EXEEXT) tests/forkbomb$(EXEEXT) \
        tests/testipc$(EXEEXT) tests/testlimit$(EXEEXT) \
        tests/testopenf$(EXEEXT) $(am__EXEEXT_6)
@@ -135,38 +135,39 @@ DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
 @ENSC_CAN_BEECRYPT_WITH_DIETLIBC_TRUE@am__append_3 = src/vhashify
 @ENSC_HAVE_BEECRYPT_TRUE@@ENSC_HAVE_C99_COMPILER_TRUE@am__append_4 = src/vhashify
 @ENSC_HAVE_C99_COMPILER_TRUE@am__append_5 = src/vdlimit
-@ENSC_HAVE_BEECRYPT_TRUE@@ENSC_HAVE_C99_COMPILER_TRUE@am__append_6 = src/testsuite/hashcalc            \
+@ENSC_HAVE_LIBNL_TRUE@am__append_6 = src/vip6-autod
+@ENSC_HAVE_BEECRYPT_TRUE@@ENSC_HAVE_C99_COMPILER_TRUE@am__append_7 = src/testsuite/hashcalc            \
 @ENSC_HAVE_BEECRYPT_TRUE@@ENSC_HAVE_C99_COMPILER_TRUE@                                 src/testsuite/hashcalc-plain
 
-@ENSC_HAVE_BEECRYPT_TRUE@@ENSC_HAVE_C99_COMPILER_TRUE@am__append_7 = src/testsuite/hashcalc-plain.sh           \
+@ENSC_HAVE_BEECRYPT_TRUE@@ENSC_HAVE_C99_COMPILER_TRUE@am__append_8 = src/testsuite/hashcalc-plain.sh           \
 @ENSC_HAVE_BEECRYPT_TRUE@@ENSC_HAVE_C99_COMPILER_TRUE@                                 src/testsuite/hashcalc.sh
 
-@HAVE_XSLTP_TRUE@am__append_8 = $(doc_gen_DOCS)
-@HAVE_XSLTPROC_TRUE@@HAVE_XSLTP_FALSE@am__append_9 = $(doc_gen_DOCS)
-@HAVE_SYSV_INIT_TRUE@am__append_10 = $(sysv_conf_DTA)
-@HAVE_SYSV_INIT_TRUE@am__append_11 = $(sysv_src_SCRPTS) \
+@HAVE_XSLTP_TRUE@am__append_9 = $(doc_gen_DOCS)
+@HAVE_XSLTPROC_TRUE@@HAVE_XSLTP_FALSE@am__append_10 = $(doc_gen_DOCS)
+@HAVE_SYSV_INIT_TRUE@am__append_11 = $(sysv_conf_DTA)
+@HAVE_SYSV_INIT_TRUE@am__append_12 = $(sysv_src_SCRPTS) \
 @HAVE_SYSV_INIT_TRUE@                  $(sysv_gen_SCRPTS)
 
-@ENSC_USE_GLIBC_TRUE@am__append_12 = $(LIBENSCVECTOR_GLIBC)
-@ENSC_USE_DIETLIBC_TRUE@am__append_13 = $(LIBENSCVECTOR_DIET)
-@USE_DIETLIBC_TRUE@am__append_14 = $(LIBINTERNAL_DIET)
-@ENSC_HAVE_C99_COMPILER_TRUE@am__append_15 = lib_internal/testsuite/filecfg-ml \
+@ENSC_USE_GLIBC_TRUE@am__append_13 = $(LIBENSCVECTOR_GLIBC)
+@ENSC_USE_DIETLIBC_TRUE@am__append_14 = $(LIBENSCVECTOR_DIET)
+@USE_DIETLIBC_TRUE@am__append_15 = $(LIBINTERNAL_DIET)
+@ENSC_HAVE_C99_COMPILER_TRUE@am__append_16 = lib_internal/testsuite/filecfg-ml \
 @ENSC_HAVE_C99_COMPILER_TRUE@                          lib_internal/testsuite/copy \
 @ENSC_HAVE_C99_COMPILER_TRUE@                          lib_internal/testsuite/isnumber \
 @ENSC_HAVE_C99_COMPILER_TRUE@                          lib_internal/testsuite/isnumber-gnu \
 @ENSC_HAVE_C99_COMPILER_TRUE@                          lib_internal/testsuite/sigbus \
 @ENSC_HAVE_C99_COMPILER_TRUE@                          lib_internal/testsuite/sigbus-gnu
 
-@ENSC_HAVE_C99_COMPILER_TRUE@am__append_16 = lib_internal/testsuite/filecfg-ml \
+@ENSC_HAVE_C99_COMPILER_TRUE@am__append_17 = lib_internal/testsuite/filecfg-ml \
 @ENSC_HAVE_C99_COMPILER_TRUE@                          lib_internal/testsuite/copy-check \
 @ENSC_HAVE_C99_COMPILER_TRUE@                          lib_internal/testsuite/isnumber \
 @ENSC_HAVE_C99_COMPILER_TRUE@                          lib_internal/testsuite/isnumber-gnu \
 @ENSC_HAVE_C99_COMPILER_TRUE@                          lib_internal/testsuite/sigbus \
 @ENSC_HAVE_C99_COMPILER_TRUE@                          lib_internal/testsuite/sigbus-gnu
 
-@ENSC_HAVE_C99_COMPILER_TRUE@am__append_17 = vserver-start/vserver.start.bin
 @ENSC_HAVE_C99_COMPILER_TRUE@am__append_18 = vserver-start/vserver.start.bin
-@HAVE_GENTOO_INIT_TRUE@am__append_19 = $(gentoo_src_SCRPTS)
+@ENSC_HAVE_C99_COMPILER_TRUE@am__append_19 = vserver-start/vserver.start.bin
+@HAVE_GENTOO_INIT_TRUE@am__append_20 = $(gentoo_src_SCRPTS)
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ensc_cflags.m4 \
@@ -797,6 +798,7 @@ am__EXEEXT_7 = src/vunify$(EXEEXT) src/vcopy$(EXEEXT) \
 pkglibPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 @ENSC_HAVE_CXX_COMPILER_TRUE@am__EXEEXT_11 = $(am__EXEEXT_1)
 @ENSC_HAVE_C99_COMPILER_TRUE@am__EXEEXT_12 = src/vdlimit$(EXEEXT)
+@ENSC_HAVE_LIBNL_TRUE@am__EXEEXT_13 = src/vip6-autod$(EXEEXT)
 sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(legacy_PROGRAMS) $(noinst_PROGRAMS) $(pkglib_PROGRAMS) \
        $(sbin_PROGRAMS)
@@ -1063,6 +1065,9 @@ src_vhashify_OBJECTS = $(am_src_vhashify_OBJECTS)
 @ENSC_CAN_BEECRYPT_WITH_DIETLIBC_TRUE@ $(am__DEPENDENCIES_9) \
 @ENSC_CAN_BEECRYPT_WITH_DIETLIBC_TRUE@ $(am__DEPENDENCIES_4) \
 @ENSC_CAN_BEECRYPT_WITH_DIETLIBC_TRUE@ $(am__DEPENDENCIES_11)
+am_src_vip6_autod_OBJECTS = src/vip6-autod.$(OBJEXT)
+src_vip6_autod_OBJECTS = $(am_src_vip6_autod_OBJECTS)
+src_vip6_autod_DEPENDENCIES = $(am__DEPENDENCIES_11)
 am_src_vkill_OBJECTS = src/src_vkill-vkill.$(OBJEXT)
 src_vkill_OBJECTS = $(am_src_vkill_OBJECTS)
 src_vkill_DEPENDENCIES = $(am__DEPENDENCIES_11)
@@ -1213,17 +1218,18 @@ SOURCES = $(nodist_lib_dietlibc_not_enabled_error_a_SOURCES) \
        $(src_vcontext_SOURCES) $(src_vcopy_SOURCES) \
        $(src_vdevmap_SOURCES) $(src_vdlimit_SOURCES) \
        $(src_vdu_SOURCES) $(src_vhashify_SOURCES) \
-       $(src_vkill_SOURCES) $(src_vlimit_SOURCES) \
-       $(src_vnamespace_SOURCES) $(src_vps_SOURCES) \
-       $(src_vreboot_SOURCES) src/vrsetup.c $(src_vsched_SOURCES) \
-       $(src_vserver_info_SOURCES) $(src_vserver_stat_SOURCES) \
-       $(src_vsh_SOURCES) $(src_vshelper_sync_SOURCES) \
-       $(src_vsysctl_SOURCES) $(src_vuname_SOURCES) \
-       $(src_vunify_SOURCES) $(src_vwait_SOURCES) \
-       $(tests_escaperoot_SOURCES) $(tests_forkbomb_SOURCES) \
-       $(tests_getctx_SOURCES) $(tests_getinitpid_SOURCES) \
-       $(tests_testipc_SOURCES) $(tests_testlimit_SOURCES) \
-       $(tests_testopenf_SOURCES) $(tests_vserver_info_SOURCES) \
+       $(src_vip6_autod_SOURCES) $(src_vkill_SOURCES) \
+       $(src_vlimit_SOURCES) $(src_vnamespace_SOURCES) \
+       $(src_vps_SOURCES) $(src_vreboot_SOURCES) src/vrsetup.c \
+       $(src_vsched_SOURCES) $(src_vserver_info_SOURCES) \
+       $(src_vserver_stat_SOURCES) $(src_vsh_SOURCES) \
+       $(src_vshelper_sync_SOURCES) $(src_vsysctl_SOURCES) \
+       $(src_vuname_SOURCES) $(src_vunify_SOURCES) \
+       $(src_vwait_SOURCES) $(tests_escaperoot_SOURCES) \
+       $(tests_forkbomb_SOURCES) $(tests_getctx_SOURCES) \
+       $(tests_getinitpid_SOURCES) $(tests_testipc_SOURCES) \
+       $(tests_testlimit_SOURCES) $(tests_testopenf_SOURCES) \
+       $(tests_vserver_info_SOURCES) \
        $(vserver_start_vserver_start_bin_SOURCES)
 DIST_SOURCES = $(am__lib_libvserver_a_SOURCES_DIST) \
        $(am__lib_internal_libinternal_diet_a_SOURCES_DIST) \
@@ -1269,17 +1275,18 @@ DIST_SOURCES = $(am__lib_libvserver_a_SOURCES_DIST) \
        $(src_vcontext_SOURCES) $(src_vcopy_SOURCES) \
        $(src_vdevmap_SOURCES) $(src_vdlimit_SOURCES) \
        $(src_vdu_SOURCES) $(src_vhashify_SOURCES) \
-       $(src_vkill_SOURCES) $(src_vlimit_SOURCES) \
-       $(src_vnamespace_SOURCES) $(src_vps_SOURCES) \
-       $(src_vreboot_SOURCES) src/vrsetup.c $(src_vsched_SOURCES) \
-       $(src_vserver_info_SOURCES) $(src_vserver_stat_SOURCES) \
-       $(src_vsh_SOURCES) $(src_vshelper_sync_SOURCES) \
-       $(src_vsysctl_SOURCES) $(src_vuname_SOURCES) \
-       $(src_vunify_SOURCES) $(src_vwait_SOURCES) \
-       $(tests_escaperoot_SOURCES) $(tests_forkbomb_SOURCES) \
-       $(tests_getctx_SOURCES) $(tests_getinitpid_SOURCES) \
-       $(tests_testipc_SOURCES) $(tests_testlimit_SOURCES) \
-       $(tests_testopenf_SOURCES) $(tests_vserver_info_SOURCES) \
+       $(src_vip6_autod_SOURCES) $(src_vkill_SOURCES) \
+       $(src_vlimit_SOURCES) $(src_vnamespace_SOURCES) \
+       $(src_vps_SOURCES) $(src_vreboot_SOURCES) src/vrsetup.c \
+       $(src_vsched_SOURCES) $(src_vserver_info_SOURCES) \
+       $(src_vserver_stat_SOURCES) $(src_vsh_SOURCES) \
+       $(src_vshelper_sync_SOURCES) $(src_vsysctl_SOURCES) \
+       $(src_vuname_SOURCES) $(src_vunify_SOURCES) \
+       $(src_vwait_SOURCES) $(tests_escaperoot_SOURCES) \
+       $(tests_forkbomb_SOURCES) $(tests_getctx_SOURCES) \
+       $(tests_getinitpid_SOURCES) $(tests_testipc_SOURCES) \
+       $(tests_testlimit_SOURCES) $(tests_testopenf_SOURCES) \
+       $(tests_vserver_info_SOURCES) \
        $(vserver_start_vserver_start_bin_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
        html-recursive info-recursive install-data-recursive \
@@ -1356,6 +1363,8 @@ ENSC_HAVE_C99_COMPILER_FALSE = @ENSC_HAVE_C99_COMPILER_FALSE@
 ENSC_HAVE_C99_COMPILER_TRUE = @ENSC_HAVE_C99_COMPILER_TRUE@
 ENSC_HAVE_CXX_COMPILER_FALSE = @ENSC_HAVE_CXX_COMPILER_FALSE@
 ENSC_HAVE_CXX_COMPILER_TRUE = @ENSC_HAVE_CXX_COMPILER_TRUE@
+ENSC_HAVE_LIBNL_FALSE = @ENSC_HAVE_LIBNL_FALSE@
+ENSC_HAVE_LIBNL_TRUE = @ENSC_HAVE_LIBNL_TRUE@
 ENSC_PATHPROG_SED = @ENSC_PATHPROG_SED@
 ENSC_USE_DIETLIBC_FALSE = @ENSC_USE_DIETLIBC_FALSE@
 ENSC_USE_DIETLIBC_TRUE = @ENSC_USE_DIETLIBC_TRUE@
@@ -1552,7 +1561,7 @@ noinst_HEADERS = $(ENSC_VECTOR_HDRS) compat.h compat-c99.h \
        lib_internal/util-perror.h lib_internal/util-safechdir.h \
        lib_internal/util-unixsock.h lib_internal/string.hc
 noinst_LIBRARIES = $(ENSC_VECTOR_LIBS) $(LIBINTERNAL_GLIBC) \
-       $(am__append_14)
+       $(am__append_15)
 lib_LIBRARIES = $(am__append_2)
 lib_LTLIBRARIES = $(LIBVSERVER_GLIBC)
 pkglib_LTLIBRARIES = src/rpm-fake.la
@@ -1564,8 +1573,8 @@ legacy_SCRIPTS = $(scripts_legacy_src_SCRPTS) \
 sbin_SCRIPTS = $(scripts_sbin_src_PRGS) $(scripts_sbin_gen_PRGS) \
        $(scripts_legacy_src_PRGS)
 noinst_DATA = $(contrib_gen_DTA)
-initrd_SCRIPTS = $(am__append_11) $(am__append_19)
-sysconf_DATA = $(am__append_10)
+initrd_SCRIPTS = $(am__append_12) $(am__append_20)
+sysconf_DATA = $(am__append_11)
 DIETPROGS = $(LIBENSCVECTOR_DIET) lib/lib_libvserver_a-% \
        ensc_fmt/lib_libvserver_a-% lib/testsuite/cflags \
        lib/testsuite/personality lib/testsuite/fmt \
@@ -1583,7 +1592,7 @@ DIETPROGS = $(LIBENSCVECTOR_DIET) lib/lib_libvserver_a-% \
        src/vsysctl src/vclone $(am__append_3) $(tests_dietprogs) \
        lib_internal/libinternal-diet.a \
        lib_internal/testsuite/isnumber lib_internal/testsuite/sigbus \
-       $(am__append_17)
+       $(am__append_18)
 BUILT_SOURCES = pathconfig.h \
                        .fixups
 
@@ -1616,7 +1625,7 @@ TESTS = lib/testsuite/cflags lib/testsuite/personality \
        $(src_testsuite_check_active_PRGS) \
        $(src_testsuite_check_src_SCRPTS) \
        $(src_testsuite_check_gen_SCRPTS) ensc_vector/testsuite/test1 \
-       ensc_vector/testsuite/test2 $(am__append_16)
+       ensc_vector/testsuite/test2 $(am__append_17)
 TESTS_ENVIRONMENT =  \
        ensc_use_expensive_tests="$(ENSC_USE_EXPENSIVE_TESTS)" \
        ensc_test_debug="$(TESTS_DEBUG)" \
@@ -1628,7 +1637,7 @@ AM_CPPFLAGS = -I $(top_srcdir)/lib -I $(top_srcdir)/ensc_wrappers \
 CLEANFILES = $(BUILT_SOURCES) .*.pathsubst.stamp */.*.pathsubst.stamp \
        */*/.*.pathsubst.stamp pathconfig.h .fixups lib/libvserver.la \
        lib/libvserver.a lib/apidoc/.apidoc doc/*.raw.html* \
-       doc/*.html.tmp $(am__append_8) $(am__append_9) \
+       doc/*.html.tmp $(am__append_9) $(am__append_10) \
        $(scripts_pkglib_gen_DTA) $(scripts_sbin_gen_PRGS) \
        $(scripts_sbincfg_gen_DTA) $(scripts_legacy_gen_SCRPTS) \
        $(sysv_gen_SCRPTS) $(contrib_gen_DTA) libensc_vector-diet.a \
@@ -1975,6 +1984,9 @@ src_vsysctl_LDFLAGS = $(VSERVER_LDFLGS)
 src_vclone_SOURCES = src/vclone.c
 src_vclone_LDADD = $(LIBINTERNAL) $(VSERVER_LDADDS)
 src_vclone_LDFLAGS = $(VSERVER_LDLFGS)
+src_vip6_autod_SOURCES = src/vip6-autod.c
+src_vip6_autod_LDADD = $(VSERVER_LDADDS) -lnl
+src_vip6_autod_LDFLAGS = $(VSERVER_LDFLGS)
 @ENSC_HAVE_C99_COMPILER_FALSE@src_sbin_C99_X_PROGS = 
 @ENSC_HAVE_C99_COMPILER_TRUE@src_sbin_C99_X_PROGS = $(src_sbin_C99_PROGS)
 @ENSC_HAVE_C99_COMPILER_FALSE@src_pkglib_C99_X_PROGS = 
@@ -1988,11 +2000,11 @@ src_testsuite_check_active_PRGS = src/testsuite/vunify-functest \
                                        src/testsuite/chbind-test
 
 src_testsuite_check_passive_PRGS = src/testsuite/rpm-fake-test \
-       $(am__append_6)
+       $(am__append_7)
 @ENSC_HAVE_C99_COMPILER_FALSE@src_testsuite_check_src_C99_SCRPTS = 
 @ENSC_HAVE_C99_COMPILER_TRUE@src_testsuite_check_src_C99_SCRPTS =  \
 @ENSC_HAVE_C99_COMPILER_TRUE@  src/testsuite/vunify-test.sh \
-@ENSC_HAVE_C99_COMPILER_TRUE@  $(am__append_7)
+@ENSC_HAVE_C99_COMPILER_TRUE@  $(am__append_8)
 src_testsuite_check_src_SCRPTS = $(src_testsuite_check_src_C99_SCRPTS)
 src_testsuite_check_gen_SCRPTS = 
 src_testsuite_rpm_fake_test_SOURCES = src/testsuite/rpm-fake-test.c
@@ -2080,7 +2092,8 @@ scripts_pkglib_src_SCRPTS = scripts/pkgmgmt \
                                scripts/vservers.grabinfo.sh \
                                scripts/vshelper \
                                scripts/vsysvwrapper \
-                               scripts/vyum-worker
+                               scripts/vyum-worker \
+                               scripts/vserver.convert
 
 scripts_legacy_src_SCRPTS = scripts/legacy/save_s_context \
                                scripts/legacy/vserver \
@@ -2105,7 +2118,8 @@ scripts_sbin_src_PRGS = scripts/chbind \
                                scripts/vupdateworld \
                                scripts/vuseradd \
                                scripts/vuserdel \
-                               scripts/vyum
+                               scripts/vyum \
+                               scripts/convert-vserver-configs
 
 scripts_sbin_gen_PRGS = 
 scripts_sbincfg_gen_DTA = 
@@ -2186,7 +2200,7 @@ libensc_vector_glibc_a_SOURCES = $(ENSC_VECTOR_SRCS)
 libensc_vector_glibc_a_CPPFLAGS = $(AM_CPPFLAGS)
 libensc_vector_diet_a_SOURCES = $(ENSC_VECTOR_SRCS)
 libensc_vector_diet_a_CPPFLAGS = $(AM_CPPFLAGS)
-ENSC_VECTOR_LIBS = $(am__append_12) $(am__append_13)
+ENSC_VECTOR_LIBS = $(am__append_13) $(am__append_14)
 @ENSC_USE_GLIBC_FALSE@LIBENSCVECTOR_GLIBC = lib-glibc-not-enabled-error.a
 @ENSC_USE_GLIBC_TRUE@LIBENSCVECTOR_GLIBC = libensc_vector-glibc.a
 @ENSC_USE_DIETLIBC_FALSE@LIBENSCVECTOR_DIET = lib-dietlibc-not-enabled-error.a
@@ -3732,6 +3746,11 @@ src/vhashify.$(OBJEXT): src/$(am__dirstamp) \
 src/vhashify$(EXEEXT): $(src_vhashify_OBJECTS) $(src_vhashify_DEPENDENCIES) src/$(am__dirstamp)
        @rm -f src/vhashify$(EXEEXT)
        $(LINK) $(src_vhashify_LDFLAGS) $(src_vhashify_OBJECTS) $(src_vhashify_LDADD) $(LIBS)
+src/vip6-autod.$(OBJEXT): src/$(am__dirstamp) \
+       src/$(DEPDIR)/$(am__dirstamp)
+src/vip6-autod$(EXEEXT): $(src_vip6_autod_OBJECTS) $(src_vip6_autod_DEPENDENCIES) src/$(am__dirstamp)
+       @rm -f src/vip6-autod$(EXEEXT)
+       $(LINK) $(src_vip6_autod_LDFLAGS) $(src_vip6_autod_OBJECTS) $(src_vip6_autod_LDADD) $(LIBS)
 src/src_vkill-vkill.$(OBJEXT): src/$(am__dirstamp) \
        src/$(DEPDIR)/$(am__dirstamp)
 src/vkill$(EXEEXT): $(src_vkill_OBJECTS) $(src_vkill_DEPENDENCIES) src/$(am__dirstamp)
@@ -4490,6 +4509,7 @@ mostlyclean-compile:
        -rm -f src/vdlimit.$(OBJEXT)
        -rm -f src/vdu.$(OBJEXT)
        -rm -f src/vhashify.$(OBJEXT)
+       -rm -f src/vip6-autod.$(OBJEXT)
        -rm -f src/vlimit.$(OBJEXT)
        -rm -f src/vlogin.$(OBJEXT)
        -rm -f src/vnamespace.$(OBJEXT)
@@ -4891,6 +4911,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vdlimit.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vdu.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vhashify.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vip6-autod.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vlimit.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vlogin.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vnamespace.Po@am__quote@
index 4cbac65..a0cba84 100644 (file)
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
+/* Define to 1 if you have the <netlink/netlink.h> header file. */
+#undef HAVE_NETLINK_NETLINK_H
+
+/* Define to 1 if you have the <netlink/route/addr.h> header file. */
+#undef HAVE_NETLINK_ROUTE_ADDR_H
+
 /* Define to 1 if the system has the type `nid_t'. */
 #undef HAVE_NID_T
 
index 3f23f01..d9e3794 100755 (executable)
--- a/configure
+++ b/configure
@@ -465,7 +465,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os GPG_KEY CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir ENSC_HAVE_CXX_COMPILER_TRUE ENSC_HAVE_CXX_COMPILER_FALSE ENSC_HAVE_C99_COMPILER_TRUE ENSC_HAVE_C99_COMPILER_FALSE ENSC_PATHPROG_SED CAT CHOWN CMP CP DIRNAME EGREP ENV GREP LN MKDIR MKFIFO MKTEMP MOUNT MV NICE PS RM RMDIR SED SH TAC TAR TOUCH TTY UMOUNT WC IP IPTABLES MODPROBE NAMEIF NOHUP RMMOD VCONFIG WGET FILE GZIP BZIP2 CPIO RESTORE RSYNC DOXYGEN XSLTP XSLTPROC HAVE_XSLTP_TRUE HAVE_XSLTP_FALSE HAVE_XSLTPROC_TRUE HAVE_XSLTPROC_FALSE LIB_DEBUG_CPPFLAGS ENSC_USE_EXPENSIVE_TESTS initrddir RELEASE_CPPFLAGS CPP DIET DIETFLAGS USE_DIETLIBC_TRUE USE_DIETLIBC_FALSE USE_DIETLIBC_COMPAT_TRUE USE_DIETLIBC_COMPAT_FALSE ENSC_USE_DIETLIBC_TRUE ENSC_USE_DIETLIBC_FALSE ENSC_USE_GLIBC_TRUE ENSC_USE_GLIBC_FALSE ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL vserverdir SVN2CL HAVE_SVN2CL_TRUE HAVE_SVN2CL_FALSE ENSC_ENABLE_INTERNAL_HEADERS_TRUE ENSC_ENABLE_INTERNAL_HEADERS_FALSE ENSC_HAVE_BEECRYPT_TRUE ENSC_HAVE_BEECRYPT_FALSE ENSC_CAN_BEECRYPT_WITH_DIETLIBC_TRUE ENSC_CAN_BEECRYPT_WITH_DIETLIBC_FALSE HAVE_GENTOO_INIT_TRUE HAVE_GENTOO_INIT_FALSE HAVE_SYSV_INIT_TRUE HAVE_SYSV_INIT_FALSE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os GPG_KEY CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir ENSC_HAVE_CXX_COMPILER_TRUE ENSC_HAVE_CXX_COMPILER_FALSE ENSC_HAVE_C99_COMPILER_TRUE ENSC_HAVE_C99_COMPILER_FALSE ENSC_PATHPROG_SED CAT CHOWN CMP CP DIRNAME EGREP ENV GREP LN MKDIR MKFIFO MKTEMP MOUNT MV NICE PS RM RMDIR SED SH TAC TAR TOUCH TTY UMOUNT WC IP IPTABLES MODPROBE NAMEIF NOHUP RMMOD VCONFIG WGET FILE GZIP BZIP2 CPIO RESTORE RSYNC DOXYGEN XSLTP XSLTPROC HAVE_XSLTP_TRUE HAVE_XSLTP_FALSE HAVE_XSLTPROC_TRUE HAVE_XSLTPROC_FALSE LIB_DEBUG_CPPFLAGS ENSC_USE_EXPENSIVE_TESTS initrddir RELEASE_CPPFLAGS CPP DIET DIETFLAGS USE_DIETLIBC_TRUE USE_DIETLIBC_FALSE USE_DIETLIBC_COMPAT_TRUE USE_DIETLIBC_COMPAT_FALSE ENSC_USE_DIETLIBC_TRUE ENSC_USE_DIETLIBC_FALSE ENSC_USE_GLIBC_TRUE ENSC_USE_GLIBC_FALSE ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL vserverdir SVN2CL HAVE_SVN2CL_TRUE HAVE_SVN2CL_FALSE ENSC_ENABLE_INTERNAL_HEADERS_TRUE ENSC_ENABLE_INTERNAL_HEADERS_FALSE ENSC_HAVE_BEECRYPT_TRUE ENSC_HAVE_BEECRYPT_FALSE ENSC_CAN_BEECRYPT_WITH_DIETLIBC_TRUE ENSC_CAN_BEECRYPT_WITH_DIETLIBC_FALSE ENSC_HAVE_LIBNL_TRUE ENSC_HAVE_LIBNL_FALSE HAVE_GENTOO_INIT_TRUE HAVE_GENTOO_INIT_FALSE HAVE_SYSV_INIT_TRUE HAVE_SYSV_INIT_FALSE LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
 
 
 
+ensc_have_libnl=yes
+
+if test x"$ensc_have_libnl" = xyes; then
+
+
+for ac_header in netlink/netlink.h netlink/route/addr.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## --------------------------------------------- ##
+## Report this to vserver@list.linux-vserver.org ##
+## --------------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+  :
+else
+   ensc_have_libnl=no
+fi
+
+done
+
+fi
+
+if test x"$ensc_have_libnl" = xyes; then
+       echo "$as_me:$LINENO: checking for rtnl_addr_alloc in -lnl" >&5
+echo $ECHO_N "checking for rtnl_addr_alloc in -lnl... $ECHO_C" >&6
+if test "${ac_cv_lib_nl_rtnl_addr_alloc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char rtnl_addr_alloc ();
+int
+main ()
+{
+rtnl_addr_alloc ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_nl_rtnl_addr_alloc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nl_rtnl_addr_alloc=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nl_rtnl_addr_alloc" >&5
+echo "${ECHO_T}$ac_cv_lib_nl_rtnl_addr_alloc" >&6
+if test $ac_cv_lib_nl_rtnl_addr_alloc = yes; then
+   :
+else
+   ensc_have_libnl=no
+fi
+
+fi
+
+if test x"$ensc_have_libnl" != xyes; then
+       { echo "$as_me:$LINENO: WARNING:
+****
+**** 'libnl' could not be found;
+**** this will disable the build of 'vip6-autod'
+****" >&5
+echo "$as_me: WARNING:
+****
+**** 'libnl' could not be found;
+**** this will disable the build of 'vip6-autod'
+****" >&2;}
+fi
+
+
+
+if test x"$ensc_have_libnl" = xyes; then
+  ENSC_HAVE_LIBNL_TRUE=
+  ENSC_HAVE_LIBNL_FALSE='#'
+else
+  ENSC_HAVE_LIBNL_TRUE='#'
+  ENSC_HAVE_LIBNL_FALSE=
+fi
+
+
+
+
 echo "$as_me:$LINENO: checking for host initscripts" >&5
 echo $ECHO_N "checking for host initscripts... $ECHO_C" >&6
 
@@ -27982,6 +28239,13 @@ echo "$as_me: error: conditional \"ENSC_CAN_BEECRYPT_WITH_DIETLIBC\" was never d
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${ENSC_HAVE_LIBNL_TRUE}" && test -z "${ENSC_HAVE_LIBNL_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"ENSC_HAVE_LIBNL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"ENSC_HAVE_LIBNL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 if test -z "${HAVE_GENTOO_INIT_TRUE}" && test -z "${HAVE_GENTOO_INIT_FALSE}"; then
   { { echo "$as_me:$LINENO: error: conditional \"HAVE_GENTOO_INIT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -28711,6 +28975,8 @@ s,@ENSC_HAVE_BEECRYPT_TRUE@,$ENSC_HAVE_BEECRYPT_TRUE,;t t
 s,@ENSC_HAVE_BEECRYPT_FALSE@,$ENSC_HAVE_BEECRYPT_FALSE,;t t
 s,@ENSC_CAN_BEECRYPT_WITH_DIETLIBC_TRUE@,$ENSC_CAN_BEECRYPT_WITH_DIETLIBC_TRUE,;t t
 s,@ENSC_CAN_BEECRYPT_WITH_DIETLIBC_FALSE@,$ENSC_CAN_BEECRYPT_WITH_DIETLIBC_FALSE,;t t
+s,@ENSC_HAVE_LIBNL_TRUE@,$ENSC_HAVE_LIBNL_TRUE,;t t
+s,@ENSC_HAVE_LIBNL_FALSE@,$ENSC_HAVE_LIBNL_FALSE,;t t
 s,@HAVE_GENTOO_INIT_TRUE@,$HAVE_GENTOO_INIT_TRUE,;t t
 s,@HAVE_GENTOO_INIT_FALSE@,$HAVE_GENTOO_INIT_FALSE,;t t
 s,@HAVE_SYSV_INIT_TRUE@,$HAVE_SYSV_INIT_TRUE,;t t
index dad7f3d..1d952bf 100644 (file)
@@ -336,6 +336,38 @@ dnl beecrypt stuff ends here}
 dnl
 dnl ########################
 
+dnl ########################
+dnl
+dnl {check for libnl
+dnl
+
+ensc_have_libnl=yes
+
+if test x"$ensc_have_libnl" = xyes; then
+       AC_CHECK_HEADERS([netlink/netlink.h netlink/route/addr.h], [ : ],
+                        [ ensc_have_libnl=no ])
+fi
+
+if test x"$ensc_have_libnl" = xyes; then
+       AC_CHECK_LIB(nl, rtnl_addr_alloc, [ : ],
+                    [ ensc_have_libnl=no ])
+fi
+
+if test x"$ensc_have_libnl" != xyes; then
+       AC_MSG_WARN([
+****
+**** 'libnl' could not be found;
+**** this will disable the build of 'vip6-autod'
+****])
+fi
+
+AM_CONDITIONAL(ENSC_HAVE_LIBNL, test x"$ensc_have_libnl" = xyes)
+
+dnl
+dnl libnl stuff ends here}
+dnl
+dnl #######################
+
 
 dnl Check what distro this is, use Gentoo initscripts if appropriate
 AC_MSG_CHECKING([for host initscripts])
index e5f098f..2f1ef8e 100644 (file)
@@ -124,6 +124,8 @@ ENSC_HAVE_C99_COMPILER_FALSE = @ENSC_HAVE_C99_COMPILER_FALSE@
 ENSC_HAVE_C99_COMPILER_TRUE = @ENSC_HAVE_C99_COMPILER_TRUE@
 ENSC_HAVE_CXX_COMPILER_FALSE = @ENSC_HAVE_CXX_COMPILER_FALSE@
 ENSC_HAVE_CXX_COMPILER_TRUE = @ENSC_HAVE_CXX_COMPILER_TRUE@
+ENSC_HAVE_LIBNL_FALSE = @ENSC_HAVE_LIBNL_FALSE@
+ENSC_HAVE_LIBNL_TRUE = @ENSC_HAVE_LIBNL_TRUE@
 ENSC_PATHPROG_SED = @ENSC_PATHPROG_SED@
 ENSC_USE_DIETLIBC_FALSE = @ENSC_USE_DIETLIBC_FALSE@
 ENSC_USE_DIETLIBC_TRUE = @ENSC_USE_DIETLIBC_TRUE@
index 05d4809..034de80 100644 (file)
@@ -165,6 +165,10 @@ if ENSC_HAVE_C99_COMPILER
 sbin_PROGRAMS +=       src/vdlimit
 endif
 
+if ENSC_HAVE_LIBNL
+sbin_PROGRAMS +=       src/vip6-autod
+endif
+
 
 src_capchroot_SOURCES =                src/capchroot.c
 src_capchroot_LDADD =          $(VSERVER_LDADDS)
@@ -340,6 +344,10 @@ src_vclone_SOURCES         = src/vclone.c
 src_vclone_LDADD               = $(LIBINTERNAL) $(VSERVER_LDADDS)
 src_vclone_LDFLAGS             = $(VSERVER_LDLFGS)
 
+src_vip6_autod_SOURCES         = src/vip6-autod.c
+src_vip6_autod_LDADD           = $(VSERVER_LDADDS) -lnl
+src_vip6_autod_LDFLAGS         = $(VSERVER_LDFLGS)
+
 EXTRA_PROGRAMS +=              $(src_sbin_CXX_PROGS) $(src_pkglib_CXX_PROGS)
 
 TESTS_ENVIRONMENT +=           srctestsuitedir=$(top_builddir)/src/testsuite
index f45dce5..0906612 100644 (file)
@@ -1,3 +1,12 @@
+/*
+ * $Id$
+ * Copyright (c) 2007 The Trustees of Princeton University
+ * Author: Daniel Hokka Zakrisson <daniel@hozac.com>
+ *
+ * Licensed under the terms of the GNU General Public License
+ * version 2 or later.
+ */
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <dirent.h>
 #include <ctype.h>
 #include <errno.h>
+#include <signal.h>
 
 #include <asm/types.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
-/*XXX #include <linux/ipv6.h>*/
-struct in6_ifreq {
-       struct in6_addr ifr6_addr;
-       __u32           ifr6_prefixlen;
-       int             ifr6_ifindex;
-};
+/* not defined for gcc -ansi */
+typedef uint64_t __u64;
+typedef int64_t __s64;
+#include <netlink/netlink.h>
+#include <netlink/route/addr.h>
 
 typedef unsigned int nid_t;
 typedef unsigned int xid_t;
@@ -28,6 +35,10 @@ typedef unsigned int xid_t;
 
 #define HAS_ADDRESS    0x01
 #define HAS_PREFIX     0x02
+struct nid_list {
+       nid_t nid;
+       struct nid_list *next;
+};
 struct prefix_list {
        struct prefix_list *prev;
        struct prefix_list *next;
@@ -43,8 +54,11 @@ struct prefix_list {
                int prefix_len;
                time_t valid_until;
        } address;
+       struct nid_list *nids;
 };
 
+struct nl_handle *handle;
+
 /* from linux/include/net/ipv6.h */
 static inline int ipv6_prefix_equal(struct in6_addr *prefix,
                                    struct in6_addr *addr, int prefixlen)
@@ -67,34 +81,71 @@ static inline int ipv6_prefix_equal(struct in6_addr *prefix,
 
 static int add_address_to_interface(int ifindex, struct in6_addr *address, int prefix)
 {
-       struct in6_ifreq ireq;
-       int sock;
+       int err = -1;
+       struct rtnl_addr *rta;
+       struct nl_addr *nl;
 
-       ireq.ifr6_ifindex = ifindex;
-       ireq.ifr6_prefixlen = prefix;
-       memcpy(&ireq.ifr6_addr, address, sizeof(*address));
+       nl = nl_addr_build(AF_INET6, address, sizeof(struct in6_addr));
+       rta = rtnl_addr_alloc();
 
-       /* XXX should use netlink */
-       sock = socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP);
-       if (sock == -1)
-               return -1;
+       rtnl_addr_set_family(rta, AF_INET6);
+       rtnl_addr_set_ifindex(rta, ifindex);
+       rtnl_addr_set_local(rta, nl);
+       rtnl_addr_set_prefixlen(rta, prefix);
 
-       if (ioctl(sock, SIOCSIFADDR, &ireq) == -1 && errno != EEXIST) {
-               close(sock);
-               return -1;
-       }
+       if (rtnl_addr_add(handle, rta, NLM_F_REPLACE) != -1 || errno == EEXIST)
+               err = 0;
 
-       close(sock);
+       rtnl_addr_free(rta);
+       nl_addr_destroy(nl);
+       return err;
+}
+
+static int add_nid_to_list(struct prefix_list *i, nid_t nid)
+{
+       struct nid_list *n;
+       n = calloc(1, sizeof(struct nid_list));
+       if (!n)
+               return -1;
+       n->nid = nid;
+       n->next = i->nids;
+       i->nids = n;
        return 0;
 }
 
+static void cleanup_prefix(struct prefix_list *i)
+{
+       struct nid_list *n;
+
+       for (n = i->nids; n; n = n->next) {
+               struct rtnl_addr *rta;
+               struct nl_addr *nl;
+               struct in6_addr a;
+
+               memcpy(&a, &i->address.addr, sizeof(a));
+               rta = rtnl_addr_alloc();
+               nl = nl_addr_build(AF_INET6, &a, sizeof(a));
+
+               rtnl_addr_set_family(rta, AF_INET6);
+               rtnl_addr_set_ifindex(rta, i->ifindex);
+               rtnl_addr_set_local(rta, nl);
+               rtnl_addr_set_prefixlen(rta, i->address.prefix_len);
+
+               /* ignore errors */
+               rtnl_addr_delete(handle, rta, 0);
+
+               nl_addr_destroy(nl);
+               rtnl_addr_free(rta);
+       }
+}
+
 static void do_slices_autoconf(struct prefix_list *head)
 {
        DIR *dp;
        struct dirent *de;
        nid_t nid;
        struct vc_net_nx addr;
-       struct prefix_list *i, *expired = NULL;
+       struct prefix_list *i;
 
        if ((dp = opendir("/proc/virtnet")) == NULL)
                return;
@@ -105,19 +156,28 @@ static void do_slices_autoconf(struct prefix_list *head)
                nid = strtoul(de->d_name, NULL, 10);
                addr.type = vcNET_IPV6;
                addr.count = -1;
-               if (vc_net_remove(nid, &addr) == -1)
+               if (vc_net_remove(nid, &addr) == -1) {
+                       perror("vc_net_remove");
                        continue;
+               }
 
                for (i = head->next; i;) {
                        /* expired */
                        if (i->mask & HAS_PREFIX && i->prefix.valid_until < time(NULL)) {
                                struct prefix_list *tmp;
+                               char buf[64];
+
+                               inet_ntop(AF_INET6, &i->address.addr, buf, sizeof(buf));
+                               printf("Address %s timed out.\n", buf);
+
                                if (i->next)
                                        i->next->prev = i->prev;
                                if (i->prev)
                                        i->prev->next = i->next;
-                               
                                tmp = i->next;
+
+                               cleanup_prefix(i);
+
                                free(i);
                                i = tmp;
                                continue;
@@ -138,6 +198,10 @@ static void do_slices_autoconf(struct prefix_list *head)
                                perror("add_address_to_interface");
                                exit(1);
                        }
+                       if (add_nid_to_list(i, nid) == -1) {
+                               perror("add_nid_to_list");
+                               exit(1);
+                       }
 next:
                        i = i->next;
                }
@@ -151,6 +215,9 @@ static int add_prefix(struct prefix_list *head, struct prefixmsg *msg,
        struct prefix_list *i = head;
        if (!msg || !prefix || !cache)
                return -1;
+       /* XXX IF_PREFIX_AUTOCONF == 0x02 */
+       if (!(msg->prefix_flags & 0x02))
+               return -1;
 
        do {
                if (i->next != NULL)
@@ -187,7 +254,7 @@ static inline int add_address(struct prefix_list *head, struct ifaddrmsg *msg,
                return -1;
 
        if (address->s6_addr[11] != 0xFF || address->s6_addr[12] != 0xFE)
-               return 0;
+               return -1;
 
        do {
                if (i->next != NULL)
@@ -215,83 +282,111 @@ static inline int add_address(struct prefix_list *head, struct ifaddrmsg *msg,
        return 1;
 }
 
-int main(int argc, char *argv[])
+static struct nla_policy addr_policy[IFA_MAX+1] = {
+       [IFA_ADDRESS]   = { .minlen = sizeof(struct in6_addr) },
+       [IFA_LABEL]     = { .type = NLA_STRING,
+                           .maxlen = IFNAMSIZ },
+       [IFA_CACHEINFO] = { .minlen = sizeof(struct ifa_cacheinfo) },
+};
+static struct nla_policy prefix_policy[PREFIX_MAX+1] = {
+       [PREFIX_ADDRESS]   = { .minlen = sizeof(struct in6_addr) },
+       [PREFIX_CACHEINFO] = { .minlen = sizeof(struct prefix_cacheinfo) },
+};
+int handle_valid_msg(struct nl_msg *msg, void *arg)
 {
-       int sock;
-       struct sockaddr_nl sa;
-       struct prefix_list head = { .prev = NULL, .next = NULL };
+       struct nlmsghdr *nlh = nlmsg_hdr(msg);
+       int ret = -1;
+       char *payload;
+       struct sockaddr_nl *source = nlmsg_get_src(msg);
+
+       payload = nlmsg_data(nlh);
+       if (source->nl_groups == RTMGRP_IPV6_PREFIX) {
+               struct prefixmsg *prefixmsg;
+               struct in6_addr *prefix = NULL;
+               struct prefix_cacheinfo *cacheinfo = NULL;
+               struct nlattr *tb[PREFIX_MAX+1];
+
+               if (nlmsg_parse(nlh, sizeof(struct prefixmsg), tb, PREFIX_MAX, prefix_policy) < 0) {
+                       printf("Failed to parse prefixmsg.\n");
+                       return -1;
+               }
 
-       sock = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
-       if (sock == -1) {
-               perror("socket()");
-               exit(1);
-       }
-       sa.nl_family = AF_NETLINK;
-       sa.nl_groups = RTMGRP_IPV6_PREFIX|RTMGRP_IPV6_IFADDR;
-       if (bind(sock, (struct sockaddr *) &sa, sizeof(sa)) == -1) {
-               perror("bind()");
-               exit(1);
+               prefixmsg = (struct prefixmsg *) payload;
+               if (tb[PREFIX_ADDRESS])
+                       prefix = nl_data_get(nla_get_data(tb[PREFIX_ADDRESS]));
+               if (tb[PREFIX_CACHEINFO])
+                       cacheinfo = nl_data_get(nla_get_data(tb[PREFIX_CACHEINFO]));
+               ret = add_prefix(arg, prefixmsg, prefix, cacheinfo);
+       }       
+       else if (source->nl_groups == RTMGRP_IPV6_IFADDR) {
+               struct ifaddrmsg *ifaddrmsg;
+               struct in6_addr *address = NULL;
+               struct ifa_cacheinfo *cacheinfo = NULL;
+               struct nlattr *tb[IFA_MAX+1];
+
+               if (nlmsg_parse(nlh, sizeof(struct ifaddrmsg), tb, IFA_MAX, addr_policy) < 0) {
+                       printf("Failed to parse ifaddrmsg.\n");
+                       return -1;
+               }
+
+               ifaddrmsg = (struct ifaddrmsg *) payload;
+               if (tb[IFA_ADDRESS])
+                       address = nl_data_get(nla_get_data(tb[IFA_ADDRESS]));
+               if (tb[IFA_CACHEINFO])
+                       cacheinfo = nl_data_get(nla_get_data(tb[IFA_CACHEINFO]));
+               ret = add_address(arg, ifaddrmsg, address, cacheinfo);
        }
+       if (ret >= 0)
+               do_slices_autoconf(arg);
 
-       while (1) {
-               char buf[4000], *payload;
-               struct nlmsghdr *nlh;
-               ssize_t len, this_len;
-               socklen_t socklen = sizeof(sa);
-
-               if ((len = recvfrom(sock, buf, sizeof(buf), 0, 
-                                   (struct sockaddr *) &sa, &socklen)) <= 0)
-                       break;
-               for (nlh = (struct nlmsghdr *) buf; NLMSG_OK(nlh, len); nlh = NLMSG_NEXT(nlh, len)) {
-                       struct nlattr *nla;
-
-                       if (nlh->nlmsg_type == NLMSG_DONE)
-                               break;
-                       else if (nlh->nlmsg_type == NLMSG_ERROR)
-                               break;
-
-                       this_len = NLMSG_ALIGN((nlh)->nlmsg_len) - NLMSG_LENGTH(0);
-                       payload = NLMSG_DATA(nlh);
-                       if (sa.nl_groups == RTMGRP_IPV6_PREFIX) {
-                               struct prefixmsg *prefixmsg;
-                               struct in6_addr *prefix;
-                               struct prefix_cacheinfo *cacheinfo;
-
-                               prefixmsg = (struct prefixmsg *) payload;
-                               prefix = NULL;
-                               cacheinfo = NULL;
-                               for (nla = (struct nlattr *)(payload + sizeof(*prefixmsg)); nla < payload + this_len; nla = (char *) nla + nla->nla_len) {
-                                       if (nla->nla_type == PREFIX_ADDRESS)
-                                               prefix = (struct in6_addr *)(((char *) nla) + sizeof(*nla));
-                                       else if (nla->nla_type == PREFIX_CACHEINFO)
-                                               cacheinfo = (struct prefix_cacheinfo *)(((char *) nla) + sizeof(*nla));
-                               }
-                               if (add_prefix(&head, prefixmsg, prefix, cacheinfo) == -1) {
-                                       printf("Adding prefix failed!\n");
-                               }
-                       }
-                       else if (sa.nl_groups == RTMGRP_IPV6_IFADDR) {
-                               struct ifaddrmsg *ifaddrmsg;
-                               struct in6_addr *address;
-                               struct ifa_cacheinfo *cacheinfo;
-
-                               ifaddrmsg = (struct ifaddrmsg *) payload;
-                               address = NULL;
-                               cacheinfo = NULL;
-                               for (nla = (struct nlattr *)(payload + sizeof(*ifaddrmsg)); nla < payload + this_len; nla = (char *) nla + nla->nla_len) {
-                                       if (nla->nla_type == IFA_ADDRESS)
-                                               address = (struct in6_addr *)(((char *) nla) + sizeof(*nla));
-                                       else if (nla->nla_type == IFA_CACHEINFO)
-                                               cacheinfo = (struct ifa_cacheinfo *)(((char *) nla) + sizeof(*nla));
-                               }
-                               if (add_address(&head, ifaddrmsg, address, cacheinfo) == -1) {
-                                       printf("Adding address failed!\n");
-                               }
-                       }
-               }
+       return 0;
+}
+
+int handle_error_msg(struct sockaddr_nl *source, struct nlmsgerr *err,
+                    void *arg)
+{
+       perror("Got an error");
+       return 0;
+}
+
+int handle_no_op(struct nl_msg *msg, void *arg)
+{
+       return 0;
+}
+
+/* only for access in the signal handler */
+struct prefix_list head;
+void signal_handler(int signal)
+{
+       switch (signal) {
+       case SIGUSR1:
                do_slices_autoconf(&head);
+               break;
+       }
+}
+
+int main(int argc, char *argv[])
+{
+       struct nl_cb *cbs;
+
+       head.prev = head.next = NULL;
+       signal(SIGUSR1, signal_handler);
+
+       handle = nl_handle_alloc_nondefault(NL_CB_VERBOSE);
+       cbs = nl_handle_get_cb(handle);
+       nl_cb_set(cbs, NL_CB_VALID, NL_CB_CUSTOM, handle_valid_msg, &head);
+       nl_cb_set(cbs, NL_CB_SEQ_CHECK, NL_CB_CUSTOM, handle_no_op, NULL);
+       nl_cb_err(cbs, NL_CB_CUSTOM, handle_error_msg, &head);
+       nl_disable_sequence_check(handle);
+
+       nl_join_groups(handle, RTMGRP_IPV6_PREFIX|RTMGRP_IPV6_IFADDR);
+       if (nl_connect(handle, NETLINK_ROUTE) == -1) {
+               perror("nl_connect");
+               exit(1);
        }
 
-       close(sock);
+       while (nl_recvmsgs(handle, cbs) > 0);
+
+       nl_close(handle);
        return 0;
 }
index 9e21389..152b33d 100644 (file)
@@ -452,7 +452,7 @@ done
 # Install the prebuilt extensions by hand
 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
 install -m 755 *.so "$python_sitelib"/
-service nm restart
+
 popd