Re: [vserver] /proc/net/dev missing when networknamespaces are active

From: Adrian Reyer <are_at_lihas.de>
Date: Thu 28 Jun 2012 - 15:53:58 BST
Message-ID: <20120628145358.GA12850@r2d2.s.lihas.de>

On Thu, Jun 28, 2012 at 01:26:58AM +0200, Herbert Poetzl wrote:
> >> please elaborate what 'the bug' is in your opinion and
> >> describe the setup where 'you used network namespaces with
> >> Linux-VServer'
> > The bug is the missing /proc/net/dev and actually the whole of
> > /proc/net when using network namespaces with linux-vserver via
> > /etc/vservers/NAME/spaces/net.
> > /proc/net is fine with 'unshare' without vserver as well
> > as with vserver with network isolation and without network
> > namespaces.
> are you sure you unshared a new network namespace?
> what is the exact command you use (with unshare) and
> what does strace -fF say on that command?

root@r2d2:~$unshare -n bash
root@r2d2:~$ip a l
31: lo: <LOOPBACK> mtu 16436 qdisc noop state DOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
root@r2d2:~$ls /proc/net/
anycast6 ip6_mr_cache ipv6_route raw stat
arp ip6_mr_vif mcfilter raw6 tcp
dev ip6_tables_matches mcfilter6 route tcp6
dev_mcast ip6_tables_names netlink rpc udp
dev_snmp6 ip6_tables_targets netstat rt6_stats udp6
fib_trie ip_conntrack nf_conntrack rt_acct udplite
fib_triestat ip_conntrack_expect nf_conntrack_expect rt_cache udplite6
icmp ip_mr_cache packet snmp unix
if_inet6 ip_mr_vif pfkey snmp6 wireless
igmp ip_tables_matches protocols sockstat
igmp6 ip_tables_names psched sockstat6
ip6_flowlabel ip_tables_targets ptype softnet_stat

The output of "strace -fF unshare -n bash" is attached as unshare.strace

root@r2d2:~$unshare cat /proc/net/dev # 'Forgot' the -n
Inter-| Receive | Transmit
 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
   br1: 0 0 0 0 0 0 0 0 718736 8837 0 0 0 0 0 0
  eth0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    lo: 768414754 976071 0 0 0 0 0 0 768414754 976071 0 0 0 0 0 0
  tap0: 244602260 374582 0 0 0 0 0 0 55469121 541839 0 0 0 0 0 0
 wlan0: 605412967 1444087 0 0 0 0 0 0 205224492 1434340 0 0 0 0 0 0
root@r2d2:~$unshare -n cat /proc/net/dev
Inter-| Receive | Transmit
 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
    lo: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Result of the second is attached as unshare-proc-net-dev.strace

If you need a strace of something similar with a vserver with
/etc/vservers/NAME/spaces/net present, I need a sample command line.

Regards,
        Adrian

-- 
LiHAS - Adrian Reyer - Hessenwiesenstra├če 10 - D-70565 Stuttgart
Fon: +49 (7 11) 78 28 50 90 - Fax:  +49 (7 11) 78 28 50 91
Mail: lihas_at_lihas.de - Web: http://lihas.de
Linux, Netzwerke, Consulting & Support - USt-ID: DE 227 816 626 Stuttgart

Received on Thu Jun 28 15:54:24 2012
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 28 Jun 2012 - 15:54:24 BST by hypermail 2.1.8