About this list Date view Thread view Subject view Author view Attachment view

From: Jacques Gelinas (jack_at_solucorp.qc.ca)
Date: Wed 13 Feb 2002 - 19:09:45 GMT


On Wed, 13 Feb 2002 14:04:07 -0500, Martin Josefsson wrote
> Hi,
>
> I noticed that it's possible to see all ipaddresses on all interfaces in
> an vserver when it should only be possible to see the ipv4root address.
>
> ifconfig works as it should but ip from the iproute2 package uses netlink
> IIRC and there I can see all addresses of all interfaces.

Here is a fix, relative to 2.4.17ctx-7. You still see the list of device, but only
the IP address of your ipv4root.

*** net/ipv4/devinet.bak Thu Jan 31 14:37:27 2002
--- net/ipv4/devinet.c Wed Feb 13 13:33:31 2002
***************
*** 918,923 ****
--- 918,926 ----
                  read_lock(&in_dev->lock);
                  for (ifa = in_dev->ifa_list, ip_idx = 0; ifa;
                       ifa = ifa->ifa_next, ip_idx++) {
+ if (current->s_context != 0
+ && current->ipv4root != 0
+ && current->ipv4root != ifa->ifa_local) continue;
                          if (ip_idx < s_ip_idx)
                                  continue;
                          if (inet_fill_ifaddr(skb, ifa, NETLINK_CB(cb->skb).pid,

---------------------------------------------------------
Jacques Gelinas <jack_at_solucorp.qc.ca>
vserver: run general purpose virtual servers on one box, full speed!
http://www.solucorp.qc.ca/miscprj/s_context.hc


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 06 Nov 2002 - 07:03:39 GMT by hypermail 2.1.3