diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2019-01-19 20:19:13 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2019-01-20 01:49:11 +0100 |
commit | 81bd033cbb535281388616f9beb99c6882ae67c8 (patch) | |
tree | a559c78e70933980e4cf248a255a653855b4159c /lib/vrf.c | |
parent | zebra, lib: send VRF backend to the client daemons (diff) | |
download | frr-81bd033cbb535281388616f9beb99c6882ae67c8.tar.xz frr-81bd033cbb535281388616f9beb99c6882ae67c8.zip |
lib: remove the vrf_is_mapped_on_netns() function
Now that all daemons receive the VRF backend from zebra, we can get
rid of vrf_is_mapped_on_netns() in favor of using the more convenient
vrf_is_backend_netns() function, which doesn't require any argument.
This commit also fixes the following problem:
debian(config)# ip route 50.0.0.0/8 blackhole vrf FAKE table 2
% table param only available when running on netns-based vrfs
Even when zebra was started with the --vrfwnetns, the error
above would be displayed since the VRF FAKE didn't exist, which
would make vrf_is_mapped_on_netns() return 0 incorrectly. Using
vrf_is_backend_netns() this problem doesn't happen anymore.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/vrf.c')
-rw-r--r-- | lib/vrf.c | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -716,13 +716,6 @@ int vrf_netns_handler_create(struct vty *vty, struct vrf *vrf, char *pathname, return CMD_SUCCESS; } -int vrf_is_mapped_on_netns(struct vrf *vrf) -{ - if (!vrf || vrf->data.l.netns_name[0] == '\0') - return 0; - return 1; -} - /* vrf CLI commands */ DEFUN_NOSH(vrf_exit, vrf_exit_cmd, @@ -953,7 +946,7 @@ int vrf_bind(vrf_id_t vrf_id, int fd, char *name) if (fd < 0 || name == NULL) return fd; - if (vrf_is_mapped_on_netns(vrf_lookup_by_id(vrf_id))) + if (vrf_is_backend_netns()) return fd; #ifdef SO_BINDTODEVICE ret = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, name, strlen(name)+1); |