summaryrefslogtreecommitdiffstats
path: root/lib/vrf.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-03-02 19:00:46 +0100
committerRenato Westphal <renatowestphal@gmail.com>2019-03-29 15:32:21 +0100
commit8f88441d717c0ded412543cceabf0ddd93ee9f09 (patch)
tree0a460d2da46a5b910535529c92e8db2fa5ff2a74 /lib/vrf.c
parentyang: sync the IETF module translator with the latest frr-ripd changes (diff)
parentMerge pull request #3894 from donaldsharp/install_replace (diff)
downloadfrr-8f88441d717c0ded412543cceabf0ddd93ee9f09.tar.xz
frr-8f88441d717c0ded412543cceabf0ddd93ee9f09.zip
Merge remote-tracking branch 'frr/master' into rip-vrf
Merge commit to solve a bunch of conflicts with other PRs that were merged in the previous weeks. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/vrf.c')
-rw-r--r--lib/vrf.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/vrf.c b/lib/vrf.c
index e1f27b7e7..a3195de08 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -471,7 +471,7 @@ static const struct cmd_variable_handler vrf_var_handlers[] = {
/* Initialize VRF module. */
void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *),
- int (*disable)(struct vrf *), int (*delete)(struct vrf *),
+ int (*disable)(struct vrf *), int (*destroy)(struct vrf *),
int ((*update)(struct vrf *)))
{
struct vrf *default_vrf;
@@ -485,7 +485,7 @@ void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *),
vrf_master.vrf_new_hook = create;
vrf_master.vrf_enable_hook = enable;
vrf_master.vrf_disable_hook = disable;
- vrf_master.vrf_delete_hook = delete;
+ vrf_master.vrf_delete_hook = destroy;
vrf_master.vrf_update_name_hook = update;
/* The default VRF always exists. */
@@ -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, const 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);