]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_pw.c
bgpd: Rework BGP dampening to be per AFI/SAFI
[mirror_frr.git] / zebra / zebra_pw.c
index 2d6ec4ec01db5a21858b2ff863cb45c97cc937b1..09edbc9a68a6a2913118262cf5837f97fa3ca38e 100644 (file)
@@ -96,9 +96,10 @@ void zebra_pw_del(struct zebra_vrf *zvrf, struct zebra_pw *pw)
        zebra_deregister_rnh_pseudowire(pw->vrf_id, pw);
 
        /* uninstall */
-       if (pw->status == PW_STATUS_UP)
+       if (pw->status == PW_STATUS_UP) {
                hook_call(pw_uninstall, pw);
-       else if (pw->install_retry_timer)
+               dplane_pw_uninstall(pw);
+       } else if (pw->install_retry_timer)
                THREAD_TIMER_OFF(pw->install_retry_timer);
 
        /* unlink and release memory */
@@ -152,6 +153,7 @@ 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 {
                /*
@@ -169,7 +171,8 @@ static void zebra_pw_install(struct zebra_pw *pw)
                           pw->vrf_id, pw->ifname,
                           zebra_route_string(pw->protocol));
 
-       if (hook_call(pw_install, pw)) {
+       hook_call(pw_install, pw);
+       if (dplane_pw_install(pw) == ZEBRA_DPLANE_REQUEST_FAILURE) {
                zebra_pw_install_failure(pw);
                return;
        }
@@ -190,6 +193,7 @@ static void zebra_pw_uninstall(struct zebra_pw *pw)
 
        /* ignore any possible error */
        hook_call(pw_uninstall, pw);
+       dplane_pw_uninstall(pw);
 
        if (zebra_pw_enabled(pw))
                zebra_pw_update_status(pw, PW_STATUS_DOWN);