mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 17:13:46 +00:00
zebra, ldpd: fix display of pseudowire status
In some circumstances zebra and ldpd would display a pseudowire as UP when in reality it's not (example: MTU mismatch between the two ends). Fix this to avoid confusion. Reported-by: ßingen <bingen@voltanet.io> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
69df82f3b5
commit
3c5b5220f7
@ -550,7 +550,8 @@ l2vpn_pw_ctl(pid_t pid)
|
|||||||
sizeof(pwctl.ifname));
|
sizeof(pwctl.ifname));
|
||||||
pwctl.pwid = pw->pwid;
|
pwctl.pwid = pw->pwid;
|
||||||
pwctl.lsr_id = pw->lsr_id;
|
pwctl.lsr_id = pw->lsr_id;
|
||||||
if (pw->local_status == PW_FORWARDING &&
|
if (pw->enabled &&
|
||||||
|
pw->local_status == PW_FORWARDING &&
|
||||||
pw->remote_status == PW_FORWARDING)
|
pw->remote_status == PW_FORWARDING)
|
||||||
pwctl.status = 1;
|
pwctl.status = 1;
|
||||||
|
|
||||||
|
@ -767,11 +767,12 @@ lde_send_change_klabel(struct fec_node *fn, struct fec_nh *fnh)
|
|||||||
sizeof(kr));
|
sizeof(kr));
|
||||||
break;
|
break;
|
||||||
case FEC_TYPE_PWID:
|
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)
|
fnh->remote_label == NO_LABEL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pw = (struct l2vpn_pw *) fn->data;
|
pw->enabled = true;
|
||||||
pw2zpw(pw, &zpw);
|
pw2zpw(pw, &zpw);
|
||||||
zpw.local_label = fn->local_label;
|
zpw.local_label = fn->local_label;
|
||||||
zpw.remote_label = fnh->remote_label;
|
zpw.remote_label = fnh->remote_label;
|
||||||
@ -818,6 +819,10 @@ lde_send_delete_klabel(struct fec_node *fn, struct fec_nh *fnh)
|
|||||||
break;
|
break;
|
||||||
case FEC_TYPE_PWID:
|
case FEC_TYPE_PWID:
|
||||||
pw = (struct l2vpn_pw *) fn->data;
|
pw = (struct l2vpn_pw *) fn->data;
|
||||||
|
if (!pw)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pw->enabled = false;
|
||||||
pw2zpw(pw, &zpw);
|
pw2zpw(pw, &zpw);
|
||||||
zpw.local_label = fn->local_label;
|
zpw.local_label = fn->local_label;
|
||||||
zpw.remote_label = fnh->remote_label;
|
zpw.remote_label = fnh->remote_label;
|
||||||
|
@ -409,6 +409,7 @@ struct l2vpn_pw {
|
|||||||
uint32_t pwid;
|
uint32_t pwid;
|
||||||
char ifname[IF_NAMESIZE];
|
char ifname[IF_NAMESIZE];
|
||||||
unsigned int ifindex;
|
unsigned int ifindex;
|
||||||
|
bool enabled;
|
||||||
uint32_t remote_group;
|
uint32_t remote_group;
|
||||||
uint16_t remote_mtu;
|
uint16_t remote_mtu;
|
||||||
uint32_t local_status;
|
uint32_t local_status;
|
||||||
|
@ -73,7 +73,7 @@ struct zebra_pw *zebra_pw_add(struct zebra_vrf *zvrf, const char *ifname,
|
|||||||
pw->protocol = protocol;
|
pw->protocol = protocol;
|
||||||
pw->vrf_id = zvrf_id(zvrf);
|
pw->vrf_id = zvrf_id(zvrf);
|
||||||
pw->client = client;
|
pw->client = client;
|
||||||
pw->status = PW_STATUS_UP;
|
pw->status = PW_STATUS_DOWN;
|
||||||
pw->local_label = MPLS_NO_LABEL;
|
pw->local_label = MPLS_NO_LABEL;
|
||||||
pw->remote_label = MPLS_NO_LABEL;
|
pw->remote_label = MPLS_NO_LABEL;
|
||||||
pw->flags = F_PSEUDOWIRE_CWORD;
|
pw->flags = F_PSEUDOWIRE_CWORD;
|
||||||
|
Loading…
Reference in New Issue
Block a user