summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorremi <remi@cvs.openbsd.org>2019-04-23 06:08:58 +0000
committerremi <remi@cvs.openbsd.org>2019-04-23 06:08:58 +0000
commitbce60acd42f01101bfcaa3f12153d0e9b144dc12 (patch)
tree8e458ccf0603e43ee003b8fc8c793ebbf4f38d4f
parent2d5e56402b59bede5f08d720138aefe0e3589889 (diff)
For originating router LSAs for P2P interfaces check for linkstate
instead of IF_STA_POINTTOPOINT. This makes "passive" work on P2P interfaces. Also add the "depend on" logic. Bug reported by stsp@ ok stsp@ benno@
-rw-r--r--usr.sbin/ospfd/ospfe.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c
index 762493cad81..019cc944edb 100644
--- a/usr.sbin/ospfd/ospfe.c
+++ b/usr.sbin/ospfd/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.103 2018/09/27 12:34:06 benno Exp $ */
+/* $OpenBSD: ospfe.c,v 1.104 2019/04/23 06:08:57 remi Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -900,7 +900,8 @@ orig_rtr_lsa(struct area *area)
if (ibuf_add(buf, &rtr_link, sizeof(rtr_link)))
fatalx("orig_rtr_lsa: ibuf_add failed");
}
- if (iface->state & IF_STA_POINTTOPOINT) {
+ if ((iface->flags & IFF_UP) &&
+ LINK_STATE_IS_UP(iface->linkstate)) {
log_debug("orig_rtr_lsa: stub net, "
"interface %s", iface->name);
bzero(&rtr_link, sizeof(rtr_link));
@@ -912,7 +913,11 @@ orig_rtr_lsa(struct area *area)
rtr_link.data = iface->mask.s_addr;
}
rtr_link.type = LINK_TYPE_STUB_NET;
- rtr_link.metric = htons(iface->metric);
+ if (iface->dependon[0] != '\0' &&
+ iface->depend_ok == 0)
+ rtr_link.metric = MAX_METRIC;
+ else
+ rtr_link.metric = htons(iface->metric);
num_links++;
if (ibuf_add(buf, &rtr_link, sizeof(rtr_link)))
fatalx("orig_rtr_lsa: ibuf_add failed");