diff options
author | 2019-04-23 06:08:57 +0000 | |
---|---|---|
committer | 2019-04-23 06:08:57 +0000 | |
commit | 7b5ae6e39cb1848ad9d1d1522703eaa9928940a4 (patch) | |
tree | e40aba054935c6453fb80262e46dfb528761e680 | |
parent | Report slot types recursively for recursive PTE entries (diff) | |
download | wireguard-openbsd-7b5ae6e39cb1848ad9d1d1522703eaa9928940a4.tar.xz wireguard-openbsd-7b5ae6e39cb1848ad9d1d1522703eaa9928940a4.zip |
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.c | 11 |
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"); |