diff options
author | Feng Lu <lu.feng@6wind.com> | 2014-07-03 18:24:34 +0800 |
---|---|---|
committer | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2015-06-03 17:26:27 +0200 |
commit | 55cfa2f190620f7c711944637659bc208970324d (patch) | |
tree | 13e8a607e6e552da0f4218b4a8473dbcd738845b /configure.ac | |
parent | c99f3481a598e9cadd1de96714f6b5df9ad85c4a (diff) | |
download | quagga-55cfa2f190620f7c711944637659bc208970324d.tar.bz2 quagga-55cfa2f190620f7c711944637659bc208970324d.tar.xz |
lib, vtysh: support multiple VRFs by using linux netns
We realize VRFs with linux netns by default. The main job is
to associate a VRF with a netns. Currently this is done by
the configuration:
[no] vrf N netns <netns-name>
This command is also available in vtysh and goes to only
zebra, because presently only zebra supports multiple VRF.
A file descriptor is added to "struct vrf". This is for the
associated netns file. Once the command "vrf N netns NAME"
is executed, the specified file is opened and the file
descriptor is stored in the VRF N. In this way the
association is formed.
In vrf_socket(), we first switch to the specified VRF by
using the stored file descriptor, and then can allocate
a socket which is working in the associated netns.
Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Diffstat (limited to 'configure.ac')
-rwxr-xr-x | configure.ac | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index f68d86fc..6da65f34 100755 --- a/configure.ac +++ b/configure.ac @@ -801,6 +801,14 @@ AC_CHECK_FUNCS(setproctitle, , ] ) +AC_CHECK_HEADER([asm-generic/unistd.h], + [AC_CHECK_DECL(__NR_setns, + AC_DEFINE(HAVE_NETNS,, Have netns),, + QUAGGA_INCLUDES [#include <asm-generic/unistd.h> + ]) + AC_CHECK_FUNCS(setns, AC_DEFINE(HAVE_SETNS,, Have setns))] + ) + dnl ------------------------------------ dnl Determine routing get and set method dnl ------------------------------------ |