]> git.proxmox.com Git - mirror_frr.git/blobdiff - ldpd/lde.c
zebra, ldpd: fix display of pseudowire status
[mirror_frr.git] / ldpd / lde.c
index b597d967d7341c7ff71f5a9f8ae1aae60a7201c7..63e1e399463688a544cf16a4b9d97cdd9d9f10b2 100644 (file)
@@ -767,11 +767,12 @@ lde_send_change_klabel(struct fec_node *fn, struct fec_nh *fnh)
                    sizeof(kr));
                break;
        case FEC_TYPE_PWID:
-               if (fn->local_label == NO_LABEL ||
+               pw = (struct l2vpn_pw *) fn->data;
+               if (!pw || fn->local_label == NO_LABEL ||
                    fnh->remote_label == NO_LABEL)
                        return;
 
-               pw = (struct l2vpn_pw *) fn->data;
+               pw->enabled = true;
                pw2zpw(pw, &zpw);
                zpw.local_label = fn->local_label;
                zpw.remote_label = fnh->remote_label;
@@ -818,6 +819,10 @@ lde_send_delete_klabel(struct fec_node *fn, struct fec_nh *fnh)
                break;
        case FEC_TYPE_PWID:
                pw = (struct l2vpn_pw *) fn->data;
+               if (!pw)
+                       return;
+
+               pw->enabled = false;
                pw2zpw(pw, &zpw);
                zpw.local_label = fn->local_label;
                zpw.remote_label = fnh->remote_label;