]> git.proxmox.com Git - mirror_iproute2.git/commit - ip/ipvrf.c
ip vrf: Handle VRF nesting in namespace
authorDavid Ahern <dsa@cumulusnetworks.com>
Thu, 16 Feb 2017 16:58:57 +0000 (08:58 -0800)
committerStephen Hemminger <sthemmin@microsoft.com>
Fri, 17 Feb 2017 23:33:24 +0000 (15:33 -0800)
commit6a9783831c081c1b759ff3bcd704c37bcc3775de
treee1e93acb75461203d390e9f6464dabefa52707f1
parent9c49438a6716c7ac5fc2d7ff757bbe6cd9805ba8
ip vrf: Handle VRF nesting in namespace

Since cgroups are not namespace aware, the directory heirarchy used by
ip vrf should account for network namespaces. In this case, change the
path from CGRP/BASE/vrf/NAME to CGRP/BASE/NETNS/vrf/NAME where CGRP is
the cgroup2 mount path, BASE in any base heirarchy inherited before VRF
is applied and NAME is the VRF name.

The intent is as follows: a user logs into the box into some namespace
with a name known to iproute2. Some other policy may have put the
process into a BASE heirarchy. From there the user executes a task in
a VRF and in doing so the task heirarchy becomes CGRP/BASE/NETNS/vrf/NAME.
The namespace level is omitted for the default namespace.

Reported-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
ip/ipvrf.c