commit 61bf3b6f9f4bbcea2e1989529b6360778a4c1ce3
Author: Arkadiusz Miƛkiewicz <[email protected]>
Date:   Thu Mar 20 19:13:52 2014 +0100

    Add additional vs isolation net detection method using /proc/self/ninfo 
(available for example on 3.13 kernel).

 lib/functions | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/lib/functions b/lib/functions
index 5956a97..e32f2d0 100644
--- a/lib/functions
+++ b/lib/functions
@@ -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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/61bf3b6f9f4bbcea2e1989529b6360778a4c1ce3

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to