merged with 0.26
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Sat, 22 Nov 2003 02:43:25 +0000 (02:43 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Sat, 22 Nov 2003 02:43:25 +0000 (02:43 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@447 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/.cvsignore
util-vserver/Makefile.am
util-vserver/configure.ac
util-vserver/src/ifspec.c

index 61e4aaf..ec0c74e 100644 (file)
@@ -21,6 +21,8 @@ mkinstalldirs
 pathconfig.h
 stamp-h1
 stamp-h2
+util-vserver*.diff*
+util-vserver*.patch*
 util-vserver-*.tar.bz2*
 util-vserver-*.tar.gz
 util-vserver.spec
index ba4e795..746a9cd 100644 (file)
@@ -90,8 +90,12 @@ linuxcaps.h:         ${kernelincludedir}/linux/capability.h Makefile
 
 
 linuxvirtual.h:
+if ENSC_ENABLE_INTERNAL_HEADERS
+                       ln -sf '$(top_srcdir)/lib/virtual.h' '$@'
+else
                        ln -sf '$(kernelincludedir)/linux/virtual.h' '$@' && test -e '$@' || \
                        ln -sf '$(top_srcdir)/lib/virtual.h' '$@'
+endif
 
 pathsubst_RULES                =  s!@'PKGLIBDIR'@!$(pkglibdir)!g; \
                           s!@'SBINDIR'@!$(sbindir)!g; \
index e407a9a..eb2814f 100644 (file)
@@ -24,7 +24,7 @@ dnl distribution terms that you use for the rest of that program.
 dnl  
 
 AC_PREREQ(2.57)
-AC_INIT(util-vserver, 0.25.190, enrico.scholz@informatik.tu-chemnitz.de)
+AC_INIT(util-vserver, 0.26.192, enrico.scholz@informatik.tu-chemnitz.de)
 AC_CONFIG_SRCDIR([src/capchroot.c])
 AC_CONFIG_HEADER([config.h])
 
@@ -86,10 +86,26 @@ ENSC_KERNEL_HEADERS(kernelincludedir)
 ENSC_UV_VROOTDIR(vserverdir)
 ENSC_CHANGELOG([HEAD])
 
+dnl Check whether to use external kernel headers
+AC_MSG_CHECKING([whether to use internal kernel headers])
+AC_ARG_ENABLE([internal-headers],
+              [AC_HELP_STRING([--disable-internal-headers],
+                              [use vserver specific headers from the kernel instead of the shipped versions (default: no)])],
+              [case "$enableval" in
+                 yes|no) ;;
+                 *)      AC_MSG_ERROR(['$i' is not a supported value for '--disable-internal-headers']);;
+              esac],
+              [enable_internal_headers=yes])
+
+AM_CONDITIONAL(ENSC_ENABLE_INTERNAL_HEADERS, [test x"$enable_internal_headers" = xyes])
+AC_MSG_RESULT([$enable_internal_headers])
+
+
+dnl Check for the APIs to be used
 AC_MSG_CHECKING([for supported APIs])
 AC_ARG_ENABLE([apis],
              [AC_HELP_STRING([--enable-apis=APIS],
-                             [enable support for the given apis; possible values are: legacy,compat,ALL (default: ALL)])],
+                             [enable support for the given apis; possible values are: legacy,compat,v11,ALL (default: ALL)])],
               [],
              [supported_apis=ALL])
 
index 803a15d..57ae0d0 100644 (file)
@@ -108,7 +108,7 @@ int ifconfig_print (
                struct {
                        unsigned long addr;
                        unsigned long mask;
-               } solved;
+               } solved = {0,0};
                if (addrstr != NULL && addrstr[0] != '\0'){
                        printf ("ADDR=%s\n",addrstr);
                        solved.addr = ip_cnv (addrstr);
@@ -123,6 +123,10 @@ int ifconfig_print (
                        solved.addr = addr;
                        ret = 0;
                }
+               else {
+                 perror("ioctl(SIOCGIFADDR)");
+               }
+               
                if (maskstr != NULL && maskstr[0] != '\0'){
                        printf ("NETMASK=%s\n",maskstr);
                        solved.mask = ip_cnv (maskstr);
@@ -137,6 +141,10 @@ int ifconfig_print (
                        solved.mask = addr;
                        ret = 0;
                }
+               else {
+                 perror("ioctl(SIOCGIFNETMASK)");
+               }
+               
                if (bcaststr != NULL && bcaststr[0] != '\0'){
                        printf ("BCAST=%s\n",bcaststr);
                }else if (ifconfig_ioctl(skfd,ifname,SIOCGIFBRDADDR, &ifr) >= 0){
@@ -148,7 +156,7 @@ int ifconfig_print (
                                ,(addr>>8)&0xff
                                ,addr&0xff);
                        ret = 0;
-               }else{
+               }else if (solved.addr!=0 && solved.mask!=0) {
                        // Can't get it from the kernel, compute it from the IP
                        // and the netmask
                        unsigned long addr = (solved.addr & solved.mask)