diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2019-03-02 19:00:46 +0100 |
---|---|---|
committer | Renato Westphal <renatowestphal@gmail.com> | 2019-03-29 15:32:21 +0100 |
commit | 8f88441d717c0ded412543cceabf0ddd93ee9f09 (patch) | |
tree | 0a460d2da46a5b910535529c92e8db2fa5ff2a74 /lib/vrf.c | |
parent | yang: sync the IETF module translator with the latest frr-ripd changes (diff) | |
parent | Merge pull request #3894 from donaldsharp/install_replace (diff) | |
download | frr-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.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -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); |