Add NXF_LBACK_ALLOW.
authorDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Wed, 13 Feb 2008 13:13:20 +0000 (13:13 +0000)
committerDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Wed, 13 Feb 2008 13:13:20 +0000 (13:13 +0000)
kernel-2.6.spec
linux-2.6-220-lback-feat02.diff [new file with mode: 0644]

index 3d57570..fcd6d8a 100644 (file)
@@ -148,6 +148,7 @@ Patch100: linux-2.6-100-build-nonintconfig.patch
 # Linux-VServer
 Patch200: patch-%{rpmversion}-vs%{vsversion}.diff
 Patch210: linux-2.6-210-vserver-cpu-sched.patch
+Patch220: linux-2.6-220-lback-feat02.diff
 
 # IP sets
 Patch250: linux-2.6-250-ipsets.patch
@@ -336,6 +337,7 @@ KERNEL_PREVIOUS=vanilla
 
 %ApplyPatch 200
 %ApplyPatch 210
+%ApplyPatch 220
 
 %ApplyPatch 250
 
diff --git a/linux-2.6-220-lback-feat02.diff b/linux-2.6-220-lback-feat02.diff
new file mode 100644 (file)
index 0000000..d294014
--- /dev/null
@@ -0,0 +1,24 @@
+diff -NurpP linux-2.6.22.16-vs2.3.0.32/include/linux/vserver/network.h linux-2.6.22.16-vs2.3.0.32.1/include/linux/vserver/network.h
+--- linux-2.6.22.16-vs2.3.0.32/include/linux/vserver/network.h 2007-10-05 12:29:05 +0200
++++ linux-2.6.22.16-vs2.3.0.32.1/include/linux/vserver/network.h       2008-02-07 15:35:05 +0100
+@@ -13,6 +13,7 @@
+ #define NXF_SINGLE_IP         0x00000100
+ #define NXF_LBACK_REMAP               0x00000200
++#define NXF_LBACK_ALLOW               0x00000400
+ #define NXF_HIDE_NETIF                0x02000000
+ #define NXF_HIDE_LBACK                0x04000000
+diff -NurpP linux-2.6.22.16-vs2.3.0.32/kernel/vserver/inet.c linux-2.6.22.16-vs2.3.0.32.1/kernel/vserver/inet.c
+--- linux-2.6.22.16-vs2.3.0.32/kernel/vserver/inet.c   2007-10-10 23:55:30 +0200
++++ linux-2.6.22.16-vs2.3.0.32.1/kernel/vserver/inet.c 2008-02-07 15:34:29 +0100
+@@ -212,7 +212,8 @@ int ip_v4_find_src(struct nx_info *nxi, 
+                       fl->fl4_dst = nxi->v4_lback.s_addr;
+               if (LOOPBACK(fl->fl4_src))
+                       fl->fl4_src = nxi->v4_lback.s_addr;
+-      } else if (LOOPBACK(fl->fl4_dst))
++      } else if (LOOPBACK(fl->fl4_dst) &&
++              !nx_info_flags(nxi, NXF_LBACK_ALLOW, 0))
+               return -EPERM;
+       return 0;