diff options
Diffstat (limited to 'zebra/zebra_pw.c')
| -rw-r--r-- | zebra/zebra_pw.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/zebra/zebra_pw.c b/zebra/zebra_pw.c index 610a052c31..c26b7a6157 100644 --- a/zebra/zebra_pw.c +++ b/zebra/zebra_pw.c @@ -114,8 +114,6 @@ void zebra_pw_change(struct zebra_pw *pw, ifindex_t ifindex, int type, int af, uint32_t remote_label, uint8_t flags, union pw_protocol_fields *data) { - zebra_deregister_rnh_pseudowire(pw->vrf_id, pw); - pw->ifindex = ifindex; pw->type = type; pw->af = af; @@ -127,8 +125,11 @@ void zebra_pw_change(struct zebra_pw *pw, ifindex_t ifindex, int type, int af, if (zebra_pw_enabled(pw)) zebra_register_rnh_pseudowire(pw->vrf_id, pw); - else + else { + if (pw->protocol == ZEBRA_ROUTE_STATIC) + zebra_deregister_rnh_pseudowire(pw->vrf_id, pw); zebra_pw_uninstall(pw); + } } struct zebra_pw *zebra_pw_find(struct zebra_vrf *zvrf, const char *ifname) @@ -153,7 +154,6 @@ void zebra_pw_update(struct zebra_pw *pw) { if (zebra_pw_check_reachability(pw) < 0) { zebra_pw_uninstall(pw); - zebra_pw_install_failure(pw); /* wait for NHT and try again later */ } else { /* @@ -547,13 +547,18 @@ static int zebra_pw_config(struct vty *vty) return write; } +static int zebra_pw_config(struct vty *vty); static struct cmd_node pw_node = { - PW_NODE, "%s(config-pw)# ", 1, + .name = "pw", + .node = PW_NODE, + .parent_node = CONFIG_NODE, + .prompt = "%s(config-pw)# ", + .config_write = zebra_pw_config, }; void zebra_pw_vty_init(void) { - install_node(&pw_node, zebra_pw_config); + install_node(&pw_node); install_default(PW_NODE); install_element(CONFIG_NODE, &pseudowire_if_cmd); |
