+// SPDX-License-Identifier: ISC
/* $OpenBSD$ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <zebra.h>
pw->flags |= F_PW_STATUSTLV;
else
pw->flags &= ~F_PW_STATUSTLV;
+
+ if (pw->flags & F_PW_STATUSTLV_CONF) {
+ struct fec_node *fn;
+ struct fec fec;
+ l2vpn_pw_fec(pw, &fec);
+ fn = (struct fec_node *)fec_find(&ft, &fec);
+ if (fn)
+ pw->remote_status = fn->pw_remote_status;
+ }
+
}
int
/* unknown fec */
return;
+ fn->pw_remote_status = nm->pw_status;
+
pw = (struct l2vpn_pw *) fn->data;
if (pw == NULL)
return;
return (1);
}
- if (zpw->status == PW_STATUS_UP) {
+ if (zpw->status == PW_FORWARDING) {
local_status = PW_FORWARDING;
pw->reason = F_PW_NO_ERR;
} else {
- local_status = PW_NOT_FORWARDING;
+ local_status = zpw->status;
pw->reason = F_PW_LOCAL_NOT_FWD;
}
sizeof(pwctl.ifname));
pwctl.pwid = pw->pwid;
pwctl.lsr_id = pw->lsr_id;
+ pwctl.status = PW_NOT_FORWARDING;
if (pw->enabled &&
pw->local_status == PW_FORWARDING &&
pw->remote_status == PW_FORWARDING)
- pwctl.status = 1;
+ pwctl.status = PW_FORWARDING;
lde_imsg_compose_ldpe(IMSG_CTL_SHOW_L2VPN_PW, 0,
pid, &pwctl, sizeof(pwctl));