summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan <jan@openbsd.org>2020-10-05 09:19:05 +0000
committerjan <jan@openbsd.org>2020-10-05 09:19:05 +0000
commit93b325c44fc785f601bde93685b953b41bf5bdf2 (patch)
tree2bb08cf711a90332427ddb2f280d9323b79d3dd9
parent-f - can respresent both stdin and stdout; rework the text a little (diff)
downloadwireguard-openbsd-93b325c44fc785f601bde93685b953b41bf5bdf2.tar.xz
wireguard-openbsd-93b325c44fc785f601bde93685b953b41bf5bdf2.zip
Remove redundant code and lets code looks similar
to the ospf6d counterpart. OK remi@
-rw-r--r--usr.sbin/ospfd/rde_lsdb.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.sbin/ospfd/rde_lsdb.c b/usr.sbin/ospfd/rde_lsdb.c
index c64b1d95f71..d9265135bf2 100644
--- a/usr.sbin/ospfd/rde_lsdb.c
+++ b/usr.sbin/ospfd/rde_lsdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_lsdb.c,v 1.50 2015/11/22 13:09:10 claudio Exp $ */
+/* $OpenBSD: rde_lsdb.c,v 1.51 2020/10/05 09:19:05 jan Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -383,6 +383,7 @@ lsa_add(struct rde_nbr *nbr, struct lsa *lsa)
struct lsa_tree *tree;
struct vertex *new, *old;
struct timeval tv, now, res;
+ int update = 1;
if (lsa->hdr.type == LSA_TYPE_EXTERNAL ||
lsa->hdr.type == LSA_TYPE_AS_OPAQ)
@@ -410,15 +411,13 @@ lsa_add(struct rde_nbr *nbr, struct lsa *lsa)
fatal("lsa_add");
return (1);
}
- if (!lsa_equal(new->lsa, old->lsa)) {
- if (lsa->hdr.type != LSA_TYPE_EXTERNAL &&
- lsa->hdr.type != LSA_TYPE_AS_OPAQ)
- nbr->area->dirty = 1;
- start_spf_timer();
- }
+ if (lsa_equal(new->lsa, old->lsa))
+ update = 0;
vertex_free(old);
RB_INSERT(lsa_tree, tree, new);
- } else {
+ }
+
+ if (update) {
if (lsa->hdr.type != LSA_TYPE_EXTERNAL &&
lsa->hdr.type != LSA_TYPE_AS_OPAQ)
nbr->area->dirty = 1;