]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
Add additional vs isolation net detection method using /proc/self/ninfo (available...
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 20 Mar 2014 18:13:52 +0000 (19:13 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 20 Mar 2014 18:13:52 +0000 (19:13 +0100)
lib/functions

index 5956a97ca32d90723421649548ae5c8bd858a8b3..e32f2d087ec28458ad3427307b76f9c7af945705 100644 (file)
@@ -93,16 +93,27 @@ if [ -z "$VSERVER_ISOLATION_NET" -o "$VSERVER_ISOLATION_NET" = "detect" ]; then
        VSERVER_ISOLATION_NET=no
        if [ "$VSERVER" = "yes" ]; then
                if [ -f /proc/self/nsproxy ]; then
+                       # older kernels
                        {
                                while read _t _data; do
                                        [ "$_t" = "net:" ] && break
                                done < /proc/self/nsproxy
                        } 2> /dev/null
+                       if [ "${_data##*\(}" = "I)" ]; then
+                               VSERVER_ISOLATION_NET=yes
+                       fi
+               elif [ -f /proc/self/ninfo ]; then
+                       # newer kernels
+                       {
+                               while read _t _data; do
+                                       [ "$_t" = "NCaps:" ] && break
+                               done < /proc/self/ninfo
+                       } 2> /dev/null
+                       if [ "${_t}" = "NCaps:" ]; then
+                               VSERVER_ISOLATION_NET=yes
+                       fi
                else
-                       # assume old kernel mode
-                       VSERVER_ISOLATION_NET=yes
-               fi
-               if [ "${_data##*\(}" = "I)" ]; then
+                       # assume (very?) old kernel mode
                        VSERVER_ISOLATION_NET=yes
                fi
                unset _f _data
This page took 0.330508 seconds and 4 git commands to generate.