diff -NurpP --minimal linux-2.6.16.16-vs2.0.x-rc20.0/include/net/route.h linux-2.6.16.16-vs2.0.x-rc20.1/include/net/route.h --- linux-2.6.16.16-vs2.0.x-rc20.0/include/net/route.h 2006-04-26 19:12:32 +0200 +++ linux-2.6.16.16-vs2.0.x-rc20.1/include/net/route.h 2006-05-11 18:47:46 +0200 @@ -229,8 +229,10 @@ static inline int ip_route_connect(struc return err; if (fl.fl4_dst == IPI_LOOPBACK && !vx_check(0, VX_ADMIN)) fl.fl4_dst = nx_info->ipv4[0]; +#ifdef VSERVER_REMAP_SADDR if (fl.fl4_src == IPI_LOOPBACK && !vx_check(0, VX_ADMIN)) fl.fl4_src = nx_info->ipv4[0]; +#endif } if (!fl.fl4_dst || !fl.fl4_src) { err = __ip_route_output_key(rp, &fl); diff -NurpP --minimal linux-2.6.16.16-vs2.0.x-rc20.0/kernel/vserver/Kconfig linux-2.6.16.16-vs2.0.x-rc20.1/kernel/vserver/Kconfig --- linux-2.6.16.16-vs2.0.x-rc20.0/kernel/vserver/Kconfig 2006-04-26 19:07:50 +0200 +++ linux-2.6.16.16-vs2.0.x-rc20.1/kernel/vserver/Kconfig 2006-05-11 18:44:37 +0200 @@ -38,6 +38,15 @@ config VSERVER_NGNET by the chbind tool. Do not disable it unless you exactly know what you are doing. +config VSERVER_REMAP_SADDR + bool "Remap Source IP Address" + depends on EXPERIMENTAL && !VSERVER_LEGACY + default n + help + This allows to remap the source IP address of 'local' + connections from 127.0.0.1 to the first assigned + guest IP. + config VSERVER_PROC_SECURE bool "Enable Proc Security" depends on PROC_FS diff -NurpP --minimal linux-2.6.16.16-vs2.0.x-rc20.0/net/ipv4/udp.c linux-2.6.16.16-vs2.0.x-rc20.1/net/ipv4/udp.c --- linux-2.6.16.16-vs2.0.x-rc20.0/net/ipv4/udp.c 2006-04-26 19:08:56 +0200 +++ linux-2.6.16.16-vs2.0.x-rc20.1/net/ipv4/udp.c 2006-05-11 18:49:21 +0200 @@ -617,6 +617,10 @@ int udp_sendmsg(struct kiocb *iocb, stru goto out; if (daddr == IPI_LOOPBACK && !vx_check(0, VX_ADMIN)) daddr = fl.fl4_dst = nxi->ipv4[0]; +#ifdef VSERVER_REMAP_SADDR + if (saddr == IPI_LOOPBACK && !vx_check(0, VX_ADMIN)) + saddr = fl.fl4_src = nxi->ipv4[0]; +#endif } err = ip_route_output_flow(&rt, &fl, sk, !(msg->msg_flags&MSG_DONTWAIT)); if (err)