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>
sizeof(pwctl.ifname));
pwctl.pwid = pw->pwid;
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)
pwctl.status = 1;
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;
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;
uint32_t pwid;
char ifname[IF_NAMESIZE];
unsigned int ifindex;
+ bool enabled;
uint32_t remote_group;
uint16_t remote_mtu;
uint32_t local_status;
pw->protocol = protocol;
pw->vrf_id = zvrf_id(zvrf);
pw->client = client;
- pw->status = PW_STATUS_UP;
+ pw->status = PW_STATUS_DOWN;
pw->local_label = MPLS_NO_LABEL;
pw->remote_label = MPLS_NO_LABEL;
pw->flags = F_PSEUDOWIRE_CWORD;